Index file less than expected

This morning I started getting this error from git:

fatal: index file less than expected

fatal: git status - not working

Any idea what is going on and how to solve it?

+46
git
Apr 09 2018-12-12T00:
source share
3 answers

The index file is corrupt, but it is easy to rebuild. Just delete it and add the files to the working directory again:

rm .git/index git add . 
+59
Apr 09 2018-12-12T00:
source share

If you want to save local changes, use the following:

 $ rm .git/index $ git reset HEAD . > Unstaged changes after reset: modified foo.txt modified bar.txt 
+51
Jan 30 '13 at 0:28
source share

I had the same problem and fixed the removal of .git/index and then restarting in HEAD.
You have the details here:
http://programertools.blogspot.com/2014/04/how-to-fix-fatal-index-file-smaller.html

+3
Apr 18 '14 at 3:40
source share



All Articles