Skip to content
masterclass Buddy

Git · Option

commit-msg hook

Git hooks are scripts that Git runs during commands such as commit, merge, rebase, checkout, and patch application. Some hooks can reject an operation; others run afterward for notification.

Last updated

Syntax

Executable scripts in .git/hooks/; each hook uses its documented command-specific arguments.

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • applypatch-msg
  • pre-applypatch
  • post-applypatch
  • pre-commit
  • pre-merge-commit
  • prepare-commit-msg
  • commit-msg
  • post-commit

Source: Git - githooks Documentation. Checked 2026-11-03.