Executing a git-hook after pull --rebase

╄→尐↘猪︶ㄣ 提交于 2019-12-07 05:06:37

问题


I'd like to have a hook run after doing git pull --rebase in order to check if a certain file was changed. Something along the lines of this hook.

I initially thought of using the post-rewrite hook, however that only works when commits are being rewritten, and won't run when the pull operation simply fast-forwards the branch, which is very often.

Any ideas will be appreciated.


回答1:


I ran strace git pull --rebase on a local repository, which performed a fast-forward update...

First, rewinding head to replay your work on top of it...
Fast-forwarded master to b0a60c3302973ca1878d149d61f2f612c8f27fac.

...and it looks as if git calls the post-checkout hook in this case:



来源:https://stackoverflow.com/questions/39148206/executing-a-git-hook-after-pull-rebase

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!