-
Notifications
You must be signed in to change notification settings - Fork 5
Setup 'git gud' as 'post commit' hook
-
In the
.git
folder inside your local repository, there's a folder namedhooks
. We'll work in a new file namedpost-commit
(no extension). If there's apost-commit.sample
file, rename it. -
If you already installed
git-gud
, just write the next in your file:#!/bin/sh git gud
If you prefer, you can place the
git-gud
script contents in your newpost-commit
file. -
The file must be executable, so maybe you'll need to use
chmod +x /path/to/git-gud
. -
Now, each time your complete a
git commit
in this repository, thepost-commit
script will be executed andgit-gud
will do its magic.
-
Setup a hooks folder (
core.hooksPath
) to store your scripts:# git 2.9+ (June 2016) $ git config --global core.hooksPath /path/to/global/hook
-
Follow the same instructions as above to create the
post-commit
file (steps 2, 3 and 4).If you need more information in this global setup, this SO question can be useful.
If you have any questions when using git-gud
, feel free to open a new issue ❓