Git Hooks/Make hook executable

Hooks must be executable to run.

Section: Client-Side Hooks

Make hook executable

bash
bash
chmod +x .git/hooks/pre-commit

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
Use centralized hooks path
Store hooks in a versioned directory.
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