Last active
June 26, 2017 11:10
-
-
Save abbasadel/1e4b75f97041e8827ca37b94ae411a5d to your computer and use it in GitHub Desktop.
Setup global git hook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#create a folder to hold all global hooks | |
mkdir ~/.git-hooks | |
#download the hook that prepend branch name to the commit message | |
curl https://gist.githubusercontent.com/abbasadel/ff03536b35b36ce9953c6f6a879563e8/raw --output ~/.git-hooks/prepare-commit-msg | |
#make it executable | |
chmod +x ~/.git-hooks/prepare-commit-msg | |
#set the global hook config (git 2.9+) | |
git config --global core.hooksPath ~/.git-hooks/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment