当我'推'时git钩子被推到遥控器上? [英] Are git hooks pushed to the remote when I 'git push'?
问题描述
如果我在repo / .git / hooks / post-commit的本地仓库中创建了一个新的钩子脚本,然后运行git push,钩子是否被推送到远程?那么,当其他开发者运行git pull时,他们会得到我的新钩子?
没有。挂钩是每个存储库,并且从不推送。同样,repo配置也不会被推入,也不会在 .git / info
或其他许多事情中发生。
仅推送和交换分支/标签和提交对象(以及任何可从提交中访问的东西,例如树,blob)。
If I create a new hook script in my local repository in repo/.git/hooks/post-commit and then I run "git push" are the hooks pushed to the remote? Then, when the other developers run "git pull" from the same origin will they get my new hooks?
No. Hooks are per-repository and are never pushed. Similarly, the repo config isn't pushed either, nor is anything in .git/info
, or a number of other things.
Pushing and pulling only exchanges branches/tags and commit objects (and anything reachable from a commit, e.g. trees, blobs).
这篇关于当我'推'时git钩子被推到遥控器上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!