git - 跟踪 .git/hooks 中钩子(Hook)的变化

标签 git githooks

有没有办法跟踪 git hook 的变化?我有三个钩子(Hook)只出现在我的机器上,而不是当我的其他开发人员获取时。尝试 git add 不起作用。

最佳答案

http://benjamin-meyer.blogspot.com/2008/10/git-hooks.html

Files in the .git/hooks directory are not part of the repository and so they are not tracked. A workaround is to have a git_hooks directory at the top of your repository like done in Arora and symlink .git/hooks to git_hooks whenever you clone. This way the hooks will be part of the project, under revision control and accessible to everyone.

关于git - 跟踪 .git/hooks 中钩子(Hook)的变化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4457031/

相关文章:

Git - 为什么是 "shared repositories should be bare repositories"?这是过时的建议吗?

Python 日志行未保留

git - 如何使 "nohup ./script.sh & disown"在 post-receive git hook 中工作?

wordpress - 预提交 Git Hook 可以压缩目录并将其添加到存储库吗?

git branch 在 pull 时不断地重新创建

git - 如何设置ssh key 以在不同用户下从一台机器访问github

git fsck : duplicateEntries: contains duplicate file entries - cannot push to gitlab

git - 如何使用 git 保存文件夹内容

python - git 钩子(Hook) flake8 : error: input not specified

c++ - 如何在提交时自动格式化 Rust(和 C++)代码?