看起来,如果我在全局配置文件~/.gitconfig
中设置core.hooksPath
,那么$GIT_DIR/hooks
内的挂钩将不会执行。
我们能够同时运行这两个文件夹内的钩子吗?
# for permanent
# the local config has higher precedence than the global config
git config core.hooksPath $(git rev-parse --absolute-git-dir)/hooks
git some_command
# for once
git -c core.hooksPath=.git/hooks some_command
# for permanent
git config core.hooksPath <some_path_without_hooks>
git some_command
# for once
git -c core.hooksPath=<some_path_without_hooks> some_command