我有一个git存储库,并设置了预提交钩子:
my-repo
|- .git
|- hooks
|- pre-commit # I made this file executable在那之前,一切都正常。我犯的时候钩子就跑了。
=================================
我现在在my-repo中运行my-repo。
文件夹结构是这样的:
my-repo
|- .git
|- hooks
|- git-config
|- hooks
|- pre-commit # I made this file executable as well所发生的是:
my-repo/.git/hooks中,它仍然会在commit上运行。git config --get core.hooksPath中运行my-repo输出./git-config/hooks如何使新的预提交钩子在提交时运行?
下面是我显然不太明白的文档链接:
发布于 2016-09-06 00:08:08
core.hooksPath支持是Git新版本2.9,已经与867ad08a2610526edb5723804723d371136fc643一起使用了。如果您的Git版本至少不是2.9.0,那么设置钩子路径变量将完全没有效果。
https://stackoverflow.com/questions/39332407
复制相似问题