Site icon Bytefreaks.net

Git: fatal: index file smaller than expected

Advertisements

Recently, we got the following error from git

$ git status
 fatal: index file smaller than expected

To fix it, without losing local changes, we removed the corrupted index and reset back to the HEAD using the following commands:

$ rm .git/index
$ git reset HEAD .

This post is also available in: Αγγλικα

Exit mobile version