4

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
  • go to the backups?
    – mdpc
    Nov 8, 2014 at 23:51
  • it's just the index file at fault right? i don't really want to go back and examine previous commit and manually merge many differences..
    – ina
    Nov 9, 2014 at 0:32
  • The recommendations I see say rm .git/index - note the dot. However, you may want to read all the comments at “Index file corrupt”. Nov 9, 2014 at 20:07
  • n.b. Original version before someone kindly formatted it included the .git ... is there a particular comment in that link that I'm missing?
    – ina
    Nov 10, 2014 at 4:25

1 Answer 1

8

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .