This repository is a companion to my blog post, Git Hooked.
There is a branch for each option presented in the post for managing Git hooks:
- Using Husky
- Using a local
.hooks
directory and symlinks - Using a local
.hooks
directory and Git configurations
Hooks are automatically created and use commands from the scripts
section of package.json
.
Hooks are managed by having a tracked .hooks
directory then symlinks them to the .git/hooks
directory. Symlinks are created when npm install
is run, or by invoking bin/install-hooks.sh
.
Hooks are managed by having a tracked .hooks
directory then you must update your configuration to
point to the .hooks
directory using:
git config core.hooksPath .hooks