How to run local Git project hooks in addition to core.hooksPath global hooks?

后端 未结 2 869
暗喜
暗喜 2021-01-11 17:44

Currently I\'m using

git config --global core.hooksPath ~/.git/hooks

to configure global hooks for all my git projects. But if those proje

2条回答
  •  别那么骄傲
    2021-01-11 18:28

    I think the only way is for your global hooks to check if a corresponding local hook exists and run it.

    This is not a complete solution because some hooks (pre-push, for example) accepts standard input in addition to command line parameters. If one of the hooks consumes the standard input the other doesn't have a chance.

提交回复
热议问题