Git insufficient-permission-adding-object Git could not write a new object file because the object database denied the write.

dev@local: ~/project — git
dev@local~/project$git status
[email protected]: Permission denied (publickey).
fatal: insufficient permission adding object
Diagnostics Translation
Git could not write a new object file because the object database denied the write.
waiting for resolution...
MediumVersion Control System

Reviewed for reference consistency: August 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

The operating system, not Git, stopped the write — the object database directory rejected the new object file, usually because of mixed user ownership in a shared clone.

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 error occurred during a network exchange. Your local files are untouched, but Git cannot reach the remote server.

Commands That Trigger This

A repository shared between two OS users where one created the last objects
A commit run under sudo that left root-owned files inside .git/objects
CI writing to a checkout owned by a different service account

Technical Background

01

Git writes objects through per-hash fan-out directories (the two-hex-digit prefixes). The failure names the database root because the denial happened while creating or opening one of those files — the object never reached disk, so the interrupted command leaves no half-written content in history.

02

The durable shape of the fix is ownership and sharing: aligning directory ownership with the accounts that commit, or declaring shared usage through core.sharedRepository so Git maintains group-writable permissions itself. Per-command workarounds, like repeated chown runs, decay as soon as the next mismatched account writes.

Underlying Causes

Directories under .git/objects are owned by another user with restrictive modes
A previous Git run elevated with sudo created root-owned object directories
Group write access is missing where core.sharedRepository expects it
Disk quotas or access-control lists reject writes to the object database path

Frequently Asked Questions

No. The object write failed before the commit was assembled, so history and HEAD are unchanged; the index may still hold the staged content.

Whoever wrote most recently owns the fan-out directories; without shared-repository settings, later writers from other accounts hit the permission wall.

Related Git States