“fatal: index file corrupt” keeps repeating in git

The following error keeps repeating even after I’ve tried the recommended:

rm .git/index
git reset

But I still get this error:

error: bad index file sha1 signature
fatal: index file corrupt
fatal: 'git status --porcelain' failed in submodule '[directory path omitted]'

What's wrong? What should I do?

4

1 Answer

I had that problem, and I tried to fix it with this:

rm -f .git/index
git reset

BUT it did not work. The solution? For some reason I had other .git folders in sub directories. I delete those .git folders (not the principal) and git reset again. Once they were deleted, everything worked again.

0

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like