xy2z
3/15/2018 - 9:37 AM

Add git hooks to a repository (so it can be shared)

Add git hooks to a repository (so it can be shared)

init:
	git config core.hooksPath .githooks;

Add git hooks to a repository

This only works with Git version 2.9.0 or above.

  1. Make a new directory in your repository root: mkdir .githooks and add your git hooks.
  2. Add the Makefile below to your repository root.
  3. Run the makefile: make
  4. Git add and commit the makefile and .githooks directory.