In my git repository I did an utf-8 conversion of many files, but only below the .git directory, so the .git directory was not touched. Before this conversion I created a new testing branch, but now I cannot use my repo anymore, I cannot switch back to the master. When I do:
git status
or any other git command I get:
error: bad index file sha1 signature
fatal: index file corrupt
fatal: 'git status --porcelain' failed in submodule core/kimai-mobile
I searched about it and found the command:
rm -f .git/index
and after this:
git reset
but this didn't help. I don't understand what is wrong. Then I deleted the "submodule" core/kimai-mobile and suddenly I could use it again!
I had this other git repository in this directory in which I destroyed the other index file with my conversion. My problem was, that I thought that the "main" repositorys index file was meant.
Now it is working again :)
My question is, why did git look into this submodule although I had the whole folder of this submodule in my ignorelist?
This is the ignore file of my "main" git:
.gitignore
...
# kimai mobile
kimai-mobile
...