error: cannot update the ref 'HEAD': unable to append to logs Git Origin: Build & delivery OSI layer 7 · Application Last updated 25 Nov 2026

error: cannot update the ref 'HEAD': unable to append to '.git/logs/HEAD': Permission denied

Git can't write reflog or ref files.

Exact message you may see cannot update the ref HEAD unable to append to logsunable to append to .git/logs/HEAD Permission deniederror: cannot update the ref 'HEAD': unable to append to '.git/logs/HEAD': Permission denied
Seen on: Git Linux

Meaning

Fix ownership of .git (often after using sudo), free disk space and check read-only mounts.

Common causes

  • Root-owned .git files
  • Read-only file system
  • Disk full

⚡ Quick fix

  1. sudo chown -R $USER .git
  2. Remount read-write
  3. Free space

Detailed fix by platform

Shell

  1. bash
    sudo chown -R "$USER" .git
    mount | grep " ro,"

How to diagnose

  1. Owner — you?
  2. Mount — rw?
  3. Disk — free?

🔧 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…0x80070005 — Windows Error 0x80070005 (E_ACCESSDENIED): Access is denied (Windows)0x80070005Azure 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…Commit unreachable after gc (reflog expired) — error: Could not read 4b825dc642cb6eb9a060e54bf8d69288fbee4904 / bad object after git gc (Git)Commit unreachable af…error: insufficient permission for adding an object to repository database — error: insufficient permission for adding an object to repository database .git/objects (Git)error: insufficient p…error: ca…

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.