Skip to content
Latchkey

Git Hook - CI/CD Glossary Definition

A git hook is a script Git runs automatically at points in its workflow, such as pre-commit, commit-msg, pre-push, and post-merge. Hooks live in .git/hooks/ and are used to lint, format, or block bad commits.

A git hook is a script Git runs automatically at points in its workflow, such as pre-commit, commit-msg, pre-push, and post-merge. Hooks live in .git/hooks/ and are used to lint, format, or block bad commits.

A git hook is a script Git runs automatically at points in its workflow, such as pre-commit, commit-msg, pre-push, and post-merge. Hooks live in .git/hooks/ and are used to lint, format, or block bad commits.

In CI

Local hooks do not run in CI or for other clones by default. Teams share them with tools like pre-commit or Husky, then run the same checks as a required job so nothing is bypassed.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →