Last active
January 3, 2016 16:18
-
-
Save rneuo/8488027 to your computer and use it in GitHub Desktop.
create git pre-commit hook file
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 hooks directory for git template | |
mkdir -p ~/.git_template/hooks | |
# if you don't overwrite global templates | |
cp /usr/local/share/git-core/templates/hooks/* ~/.git_template/hooks/ | |
# create pre-commit script | |
touch ~/.git_template/hooks/pre-commit | |
chmod a+x ~/.git_template/hooks/pre-commit | |
# init template directory | |
git config --global init.templatedir '~/.git_template' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment