Git Hooks
Manually Run Git Hooks
Sometimes you want to manually run a Git hook, like a pre-commit hook, for testing. This can be done from the shell. Navigate to the directory containing your Git repository cd /path/to/code Example directory: |- .git |— hooks |—– pre-commit |- src |— file.js |- READEME.md …
Testing GIT Hooks Before …
If you’re using GIT hooks and want to be able to test them without adding cruft to your GIT repository, you can easily test individual hooks anytime. GIT hooks are, by default, executable files that can be run through a simple bash command. From your repository $ bash .git/hooks/pre-commit …