GIT: “fatal: unable to write new_index file” while

2019-03-22 19:49发布

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

11条回答
老娘就宠你
2楼-- · 2019-03-22 20:05

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.

查看更多
Evening l夕情丶
3楼-- · 2019-03-22 20:07

I got this error using Cygwin and git-svn. The solution that worked for me was to do garbage collection (odd as it seemed at the time):


$ git gc

查看更多
时光不老,我们不散
4楼-- · 2019-03-22 20:12

I had same problem. In my case above solutions didn't work.

The reason behind this error is that the file .git/index was corrupted for some unknown reason. I just renamed the file to something else and run the 'git add .' command from git bash and it worked.

Hope this helps someone.

查看更多
爱情/是我丢掉的垃圾
5楼-- · 2019-03-22 20:17

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

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

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...

查看更多
\"骚年 ilove
6楼-- · 2019-03-22 20:18

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

查看更多
登录 后发表回答