Share Git Hooks With core.hooksPath
Store hooks in the repository and point Git at them for the whole team.
Run git config core.hooksPath .githooks to load hooks from a tracked directory.
01Command
Command
$ git config core.hooksPath .githooks02What it does
Hooks can lint, format or run tests before a commit, but .git/hooks is not versioned. Committing a .githooks directory and setting core.hooksPath shares the checks automatically, turning a manual practice into enforced automation.
03Risk
!Warning: Hooks run arbitrary code on checkout-independent actions; review changes to hook scripts before committing them.
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- git-githooks documentationEvidence: Documents client-side hooks including pre-commit and core.hooksPath.
Last verified: 2026-10-13 · Category: Developer