Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GIT: "fatal: unable to write new_index file" while commit

When I try to commit changes to local repo, I have got following message:
fatal: unable to write new_index file

like image 873
Stepan Kuzmin Avatar asked Sep 15 '10 05:09

Stepan Kuzmin


4 Answers

As this thread illustrates, this is usually a disk space issue:

$ git status
fatal: unable to write new_index file

One cause of this that I found was that my file system had run out of space.
Finding large directories with something like the following helped clean up some log files that had run wild :

$ du -h / | grep ^[0-9.]*G

Note: you can also see it for

  • a resource issue with msysgit and Egit (Git for Eclipse):

Problem still remained so I ran File Monitor from Sysinternals Suite.
It seems that Eclipse is accessing index file constantly and blocks command line git

  • for a classic anti-virus issue:

Yeah, looks like Windows Defender strikes again. I always forget to disable that damn thing. I can't believe how broken it is. Destroys Blu-ray playback at home, breaks Git at work...

like image 78
VonC Avatar answered Nov 09 '22 06:11

VonC


If you are using TortoiseGit, this error (or more recently: error: Unable to write index.) is very likely caused by having TortoiseGit icon overlays enabled. To disable icon overlays, go to:

TortoiseGit > Settings > Icon Overlays

and set Status cache to None. This may be fixed in a future version of TortoiseGit, but for now it seems to be common.

like image 28
Justin M. Keyes Avatar answered Nov 09 '22 06:11

Justin M. Keyes


I was getting the same error while I was merging a git repo that was sshfs mounted. There was no shortage of space anywhere.

In my case the solution was to add an -o workaround=rename option to the sshfs mount command.

Like so: sshfs -o idmap=user -o uid=[lokal uid] -o gid=[lokal gid] -o workaround=rename [host]: [mountpoint]

like image 7
Phluks Avatar answered Nov 09 '22 08:11

Phluks


I have found solution. Just need to free some disk space.

like image 4
Stepan Kuzmin Avatar answered Nov 09 '22 07:11

Stepan Kuzmin