CONFIGURED - Auto-activate git hooks via npm prepare script
Add a prepare script that runs 'git config core.hooksPath .githooks' on every npm install, so the commit-msg style gate and pre-push test gate turn on automatically per clone with nothing to remember. Guarded with '|| true' so installs never fail where git is absent (e.g. tarball deploys). Document that the deploy server never needs it since it only pulls.
This commit is contained in:
@@ -150,5 +150,8 @@ Do **not** add any `Co-Authored-By` / "Generated with Claude Code" attribution
|
||||
lines to commits in this repo. Write the body (when useful) as wrapped prose or
|
||||
bullet points explaining the *why*, matching the existing history.
|
||||
|
||||
The hook and the test gate are activated per clone with:
|
||||
`git config core.hooksPath .githooks` (emergency skip: `git commit --no-verify`).
|
||||
The hook (and the `pre-push` test gate) live in `.githooks/` and are activated
|
||||
per clone via `core.hooksPath`. You don't need to remember this: the `prepare`
|
||||
npm script runs `git config core.hooksPath .githooks` automatically on every
|
||||
`npm install`. The deploy server does not need it — it only pulls, never commits
|
||||
or pushes, so no hook ever fires there. Emergency skip: `git commit --no-verify`.
|
||||
Reference in New Issue
Block a user