如问题中所述,在将修改后的代码提取到我的生产基地之后或之时,我想通知其他人有关我的生产基地的更改或通过电子邮件在生产基地中进行的更改。
这里提到的git-hooks与我的标准不符。
任何人都可以建议我一个钩子/脚本/宝石可以做我的工作与示例?
非常感谢提前。
编辑:任何人都可以给我一个合并后钩子的样本
As mentioned in the question, after or at the time of pulling modified code to my production base i want to notify others about changes are going to be done to my production base or changes took place in production base through emails.
git-hooks mentioned here doesn't match with my criteria.
Can any one suggest me a hook/script/gem that can do my job with example?
Thanks a lot in advance.
EDIT: Can any one give me a sample of post-merge hook
最满意答案
它是重复的是拉有什么git钩子吗?
要自定义您的请求并参考此网址https://gist.github.com/sindresorhus/7996717 ,您可以在post-merge准备钩子,如下所示
#/usr/bin/env bash # git hook to run a command after `git pull` if a specified file was changed # Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`. changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" check_run() { echo "$changed_files" | mailx -s "changes found on production server!" your.mail.box@mail.com } # In this example it's used to send mail if there are any files changed. check_runit is duplicate of Is there any git hook for pull?
For customising your request and refer this url https://gist.github.com/sindresorhus/7996717, you can prepare the hook post-merge as below
#/usr/bin/env bash # git hook to run a command after `git pull` if a specified file was changed # Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`. changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" check_run() { echo "$changed_files" | mailx -s "changes found on production server!" your.mail.box@mail.com } # In this example it's used to send mail if there are any files changed. check_run更多推荐
发布评论