我有一个带有预提交钩子的git存储库:
my-repo
|- .git
|- hooks
|- pre-commit # I made this file executable
Run Code Online (Sandbox Code Playgroud)
一直到那里,一切正常.我提交时挂钩正在运行.
=================================
我现在跑git config core.hooksPath ./git-config/hooks进去了my-repo.
文件夹结构是这样的:
my-repo
|- .git
|- hooks
|- git-config
|- hooks
|- pre-commit # I made this file executable as well
Run Code Online (Sandbox Code Playgroud)
会发生什么:
my-repo/.git/hooksgit config --get core.hooksPath在my-repo输出中运行./git-config/hooks如何在提交时运行新的预提交钩子?
以下是我显然不太了解的文档的链接:
https://git-scm.com/docs/git-config
https://git-scm.com/docs/githooks