Setting up the environment
Win/Mac
For Git CLI, Git Bash, SourceTree, Intellij
Git 2.9 or newer
$ git --version git version 2.20.1
SourceTree
Install Python 3.7 or newer.
Run the following:
git config core.hooksPath .githooks
Note
All hooks are committed as executable and should work on Windows and Mac.
Eclipse with JGit
core.hooksPath
won't work because of this bug. Here are two work-arounds.
Copy the pre-commit manually to
.git/hooks
and make it executable:cp .githooks/pre-commit .git/hooks/pre-commit
Note
This work-around must be run every time the pre-commit changes.
Create a symbolic link:
ln -s -f .githooks/pre-commit .git/hooks/pre-commit
(Win) Tortoise Git
Git hooks are not supported. Try Git CLI or SourceTree.