This morning, I started getting this error from git:
fatal: index file smaller than expected
fatal: git status --porcelain failed
Any idea of what is happening and how to solve it?
The index file has become corrupted, but it is easily re-creatable. Just remove it...
rm .git/index
Then you can re-add the files you're trying to stage.
If you want to keep local changes, use the following:
$ rm .git/index $ git reset HEAD . > Unstaged changes after reset: modified foo.txt modified bar.txt
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With