dev@local: ~/project — git
dev@local~/project$git status
error: pre commit hook failed
Diagnostics Translation
A local script (hook) executed by Git failed, forcing Git to abort the commit.
waiting for resolution...
LowVersion Control System

Reviewed for reference consistency: April 11, 2026

Code is Safe

SECURE

Git has paused the operation to protect your code. No data has been lost or corrupted.

What To Know

This state points to a local policy or quality gate blocking the commit before Git writes new history.

Where Did It Fail?

Working Tree
Your local files
add
Staging Index
Prepared changes
commit
Local Repo
Commit history
push/fetch
Remote Server
GitHub/GitLab
The operation was blocked at the staging area. Git cannot prepare or finalize the commit.

Commands That Trigger This

$Trying to commit code that has a missing semicolon when ESLint hooks are enforced
Trying to commit code that has a missing semicolon when ESLint hooks are enforced
$git commit
Running in a Node.js project using Husky

Technical Background

01

This is not a Git engine failure. Git is intentionally respecting a local quality-gate script placed in the repository by a developer or team.

02

The terminal output directly above this message usually contains the specific linter or test error.

Underlying Causes

Syntax errors or linting failures caught by ESLint/Prettier
Failing unit tests run via tools like Husky
Commit message format violating team rules (e.g., missing Jira ticket number)

Frequently Asked Questions

It usually means the project defines a local quality gate and that gate returned a failing status before Git was allowed to write the commit.

Related Git States