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.
  • 58,560
  • 8
  • 81
  • 72
Nick Vanderbilt
  • 36,724
  • 29
  • 83
  • 106

2 Answers2

3

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

Community
  • 1
  • 1
asymmetric
  • 3,800
  • 3
  • 34
  • 52
0

you can set a global hooks directory with:

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