README
The goal of this repository is to test out how to do precommit hooks for a monorepo.
Configuration
Get any existing configuration
git config --get core.hooksPath
Set configuration
git config core.hooksPath .githooks
Skipping hooks
git commit -m 'commit message' --no-verify
How it works
When the git hook
runs, .githooks/pre-commit
gets fired checking for all files
that exist in .githooks/pre-commit-hooks
.
It assumes that the filename
matches the directory
in the monorepo.
Using git
it will check if any staged files have been changed. If it has been
changed it will excute the corresponding script.
Documentation
Disclaimer
I am by no means an expert at writing shell scripts. Please use with a grain of salt.