A Git template that contains a few helpful hooks written in Ruby.
-
Clone the repository:
cd ~/code git clone git@github.com:toddmazierski/git_template.git
-
Configure Git to use the template globally:
git config --global init.templatedir "~/code/git_template"
-
For new repositories, the hooks will be automatically installed:
git init
-
For existing repositories, reinitialize the repository:
rm -rf .git/hooks git init
To update the hooks for multiple, existing repositories:
ruby script/update_hooks.rb ~/code
- Language conditionals