hint: The 'pre-commit' hook was ignored because it's not set as executable Git Origin: Build & delivery OSI layer 7 · Application Last updated 25 Nov 2026

hint: The '.git/hooks/pre-commit' hook was ignored because it's not set as executable.

Git skipped your hook because it lacks exec permission.

Exact message you may see hook was ignored because it's not set as executableThe pre-commit hook was ignoredhint: The '.git/hooks/pre-commit' hook was ignored because it's not set as executable. hint: You can disable this warning with `git config advice.ignoredHook false`.
Seen on: Git

Meaning

chmod +x the hook file. On Windows check line endings (CRLF) and the shebang.

Common causes

  • Hook file not executable
  • CRLF breaks the shebang
  • Hook copied without mode

⚡ Quick fix

  1. chmod +x .git/hooks/pre-commit
  2. Convert to LF line endings
  3. Use core.hooksPath to a versioned folder

Detailed fix by platform

Shell

  1. bash
    chmod +x .git/hooks/*
    git config core.hooksPath .githooks

How to diagnose

  1. Mode — exec?
  2. EOL — LF?
  3. Path — hooksPath?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Build & delivery. Errors that are often confused with or caused by this one (click to open):

./gradlew: Permission denied — bash: ./gradlew: Permission denied (Android)./gradlew: Permission…/bin/bash^M: bad interpreter — /usr/bin/env: 'bash\r': No such file or directory (Git)/bin/bash^M: bad inte…Azure DevOps: TF401019 / VS403 push rejected — remote: TF401027: You need the GenericContribute permission to perform this action. (Git)Azure DevOps: TF40101…bash: ./script.sh: Permission denied — bash: ./script.sh: Permission denied (Linux)bash: ./script.sh: Pe…Bitbucket: Branch permissions prevent push — remote: Branch permissions: You are not allowed to push to branch main (Git)Bitbucket: Branch per…chmod: changing permissions of 'x': Operation not permitted — chmod: changing permissions of '/mnt/data/file': Operation not permitted (Linux)chmod: changing permi…commitlint: subject may not be empty / type must be one of — ✖ subject may not be empty [subject-empty] ✖ type may not be empty [type-empty] (Git)commitlint: subject m…deploy hook — Certbot renewed the certificate but the server still serves the old one (deploy hook / reload failed) (SSL / TLS)deploy hookhint: The…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.