Git & Delivery More detail B · Official guidance Platform: General

Git Hook

A Git hook is a program Git runs at a named step on a developer's computer or server. It can check, block, or automate an action.

See how it works
You might call it Git Hook

See how it works

Original worked exampleGit Hook

Another example

A pre-commit hook quickly checks staged files for format problems and secrets, then shows clear fixes. Hooks on a developer's computer are not copied by default, so they cannot be the only security gate.

Main parts

  1. 01lifecycle event
  2. 02hook program
  3. 03exit status

Use it when

Use this term for fast local automation or server rules at a documented Git step.

Do not use it when

Do not keep slow, unclear, destructive, or machine-specific required checks only in local hooks.

Name used in code

.git/hooks/<hook-name>

Before you ship

Before publishing, check the exact repository, branch, target, and diff. Keep unpublished work. Pass review and CI checks. Record conflict and data-loss risks, release order, traceability, recovery, and rollback.

Request you can copy

Outcome: Use Git Hook to release or recover the change safely, with a clear record. User context: A pre-commit hook quickly checks staged files for format problems and secrets, then shows clear fixes. Hooks on a developer's computer are not copied by default, so they cannot be the only security gate. Delivery concept or operation: Git Hook. Why it fits: Use this term for fast local automation or server rules at a documented Git step. Do not use it when: Do not keep slow, unclear, destructive, or machine-specific required checks only in local hooks. Delivery requirements: Name the code repository and target. List preconditions, changes, review and CI checks, conflict and data-loss risks, release order, and the rollback or recovery command. Repository safeguards: Keep unpublished work and a clear history. Do not run destructive steps without an explicit backup. Check the exact code diff and remote target before publishing. Acceptance criteria: Review the intended diff and pass all required checks. Keep the target version traceable. Practice failure recovery and keep published history clear. Evidence and limits (evidence boundary): It is official for that source. Other platforms or teams may use the term in another way. Unknowns to confirm: Repository, branch, team activity, release environment, approval owner, protected checks, and rollback target.

Check this request

Review the current use of Git Hook. Definition: A Git hook is a program Git runs at a named step on a developer's computer or server. It can check, block, or automate an action. Release checks: Before publishing, check the exact repository, branch, target, and diff. Keep unpublished work. Pass review and CI checks. Record conflict and data-loss risks, release order, traceability, recovery, and rollback. Before changing code, report the evidence you found, gaps, severity, and the smallest safe fix.

B
How official is this term?

Official guidance

The named platform, framework, project, or expert group has an official guide for this term.

It is official for that source. Other platforms or teams may use the term in another way.

Scope
Git
Document status
stable
Checked on
2026-07-30

Evidence sources & scope

Authority source + Term reference · Git · stable githooks Scope: Git client- and server-side hooks Role here: Direct term reference Source covers: canonical name, definition, platform API, implementation, usage guidance

Copy it yourself

The browser could not copy this. Select the request below and copy it yourself.