This morning I started getting this error from git:
fatal: index file less than expectedfatal: git status - not working
fatal: index file less than expected
fatal: git status - not working
Any idea what is going on and how to solve it?
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 .
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
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
.git/index