Git Hooks/Use centralized hooks path

Store hooks in a versioned directory.

Section: Client-Side Hooks

Use centralized hooks path

bash
bash
git config core.hooksPath .githooks

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Client-Side Hooks
Pre-commit hook path
Default path for pre-commit hook script.
OpenIn sheetshsame section
Commit-msg hook path
Default path for commit-msg hook script.
OpenIn sheetshsame section
Pre-push hook path
Default path for pre-push hook script.
OpenIn sheetshsame section
Make hook executable
Hooks must be executable to run.
OpenIn sheetbashsame section
Pre-commit lint script
Run linting before commit and fail on error.
OpenIn sheetsh1 tag match
Show hooksPath
See whether Git uses a non-default hook directory.
OpenIn sheetbash1 tag match