当我'推'时git钩子被推到遥控器上? [英] Are git hooks pushed to the remote when I 'git push'?

查看:74
本文介绍了当我'推'时git钩子被推到遥控器上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我在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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆