gitosx-elcapitan

Suddenly every git command causes `error: bad signature` in every Git repository


I have a weird problem. Today, as I was working in multiple Git repositories, all of a sudden, I started getting

$ git st
error: bad signature
fatal: index file corrupt

in every single repository.

I already tried Jakub's reply in this post How to resolve "Error: bad index – Fatal: index file corrupt" when using Git, but it didn't work. If fixed the issue for a second, but as soon as I'm doing changes to the repository (like git add somefile) the error comes back.

I know it is a really broad and unspecific question... How can I solve this?

I'm running a Mac on El Capitan (10.11.1)

Update:

I wanted to restart my computer after that incident and the Mac crashed at the startup with massive kernel errors. I booted once into SafeMode to analyse it, but couldn't find anything. So I restarted my Mac, and the kernel error was gone, including the git problem that it caused the file corrupt error. The index file of all my git repositories I did work in where still broken, but thanks to Timemachine I could restore them.

So, I think the problem was maybe related to some kernel problems, which caused that strange behaviour. Now, everything is working again.

But I will still have an eye on that, because the problem is really wired...


Solution

  • I wanted to restart my computer after that incident and the Mac crashed at the startup with massive kernel errors. I booted once into SafeMode to analyse it, but couldn't find anything. So I restarted my Mac, and the kernel error was gone, including the git problem that it caused the file corrupt error. The index file of all my git repositories I did work in where still broken, but thanks to Timemachine I could restore them.

    So, I think the problem was maybe related to some kernel problems, which caused that strange behaviour. Now, everything is working again.

    But I will still have an eye on that, because the problem is really wired...