Skip to content

Instantly share code, notes, and snippets.

@rneuo
Last active January 3, 2016 16:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rneuo/8488027 to your computer and use it in GitHub Desktop.
Save rneuo/8488027 to your computer and use it in GitHub Desktop.
create git pre-commit hook file
#!/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