dev@local: ~/project — git
dev@local~/project$git add
fatal: unable to write new index file
Diagnostics Translation
Git failed to save changes to the staging area due to a filesystem issue.
waiting for resolution...
MediumVersion 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 points to a write failure while Git was trying to replace the staging-area file on disk, usually at the filesystem or permissions layer.

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

$git add
Running when your local SSD is 100% full
$Using a Git repository that is located inside a syncing OneDrive or Google Drive folder
Using a Git repository that is located inside a syncing OneDrive or Google Drive folder

Technical Background

01

Unlike a logical Git conflict, this is a hardware or OS-level blockade.

02

Cloud sync tools are notorious for this error, as they often lock Git's internal database files to upload them while Git is trying to write to them.

Underlying Causes

The hard drive is completely out of disk space
The `.git` directory has restrictive read-only file permissions
An antivirus or file-sync tool (like Dropbox/OneDrive) locked the index file

Frequently Asked Questions

No, your working directory files are untouched. Git just couldn't record their updated state into its internal staging area.

Related Git States