-
Notifications
You must be signed in to change notification settings - Fork 5
Setup 'git gud' as 'post commit' hook
-
In the
.gitfolder 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.samplefile, rename it. -
If you already installed
git-gud, just write the next in your file:#!/bin/sh git gudIf you prefer, you can place the
git-gudscript contents in your newpost-commitfile. -
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 commitin this repository, thepost-commitscript will be executed andgit-gudwill 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-commitfile (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 ❓