Git · Option
pre-commit hook
The pre-commit hook runs before Git creates a commit. It can inspect the staged snapshot and stop the commit by exiting with a nonzero status.
Last updated
Syntax
.git/hooks/pre-commitIn-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
git-commitcommit-msgprepare-commit-msgpre-merge-commithooks.allownonascii--no-verify