@
tabris17 刚才没说完就回了。。。
因为 post-update 和 post-receive 都是所有 ref 更新完了才执行,所以先后顺序应该是不会影响的,只是时间问题而已。从描述和代码里也可以看出这两个是紧挨着执行的,没有太大的区别。
post-receive Hook
-----------------
After all refs were updated (or attempted to be updated), if any
ref update was successful, and if $GIT_DIR/hooks/post-receive
file exists and is executable, it will be invoked once with no
parameters.
post-update Hook
----------------
After all other processing, if at least one ref was updated, and
if $GIT_DIR/hooks/post-update file exists and is executable, then
post-update will be called with the list of refs that have been updated.
https://github.com/git/git/blob/master/builtin/receive-pack.c#L1772