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.
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/codeExample directory:
|- .git
|--- hooks
|----- pre-commit
|- src
|--- file.js
|- READEME.md -
Run hook using your shell
bash <path to hook> # Ex: bash .git/hooks/pre-commit