git hook_error ai_generated true

pre-commit hook failed (add --no-verify to bypass)

ID: git/pre-commit-hook-failed

Also available as: JSON · Markdown
90%Fix Rate
92%Confidence
50Evidence
2023-01-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
2 active

Root Cause

Pre-commit hook (linting, formatting, tests) found issues and blocked the commit.

generic

Workarounds

  1. 95% success Fix the issues the hook reported — run the linter/formatter manually
    Fix the issues the hook reported — run the linter/formatter manually

    Sources: https://git-scm.com/docs/githooks#_pre_commit

  2. 88% success Run the hook manually to see detailed output: .git/hooks/pre-commit
    .git/hooks/pre-commit

    Sources: https://git-scm.com/docs/githooks

  3. 80% success If false positive, use --no-verify for this one commit only
    # Skip hooks for this one commit only:
    git commit --no-verify -m 'commit message'
    
    # Only use this if you've verified the hook failure is a false positive
    # and plan to fix the hook issue separately

    Sources: https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---no-verify

Dead Ends

Common approaches that don't work:

  1. Always use --no-verify to bypass 75% fail

    Skips all quality checks — defeats the purpose of hooks

Error Chain

Frequently confused with: