4

I am reading up on hooks at https://git-scm.com/book/en/v2/Customizing-Git-An-Example-Git-Enforced-Policy. I usually put wip ( work in progress) as my commit message. I intend to go back and clean it up but sometimes I push changes with message wip. I would like to prevent that.

However rather than putting hook just for one project I would like this wip hook to be in all my projects. Is there a way to setup global hooks.

ax.
  • 56,201
  • 7
  • 77
  • 69
Nick Vanderbilt
  • 34,224
  • 27
  • 82
  • 104

2 Answers2

3

Look here Git commit hooks - global settings, which works thanks to this

Community
  • 1
  • 1
asymmetric
  • 3,666
  • 3
  • 33
  • 51
0

you can set a global hooks directory with:

git config --global core.hooksPath ~/.git-hooks
Lluís
  • 1,215
  • 1
  • 14
  • 36