For some reason my Git index file keeps on getting corrupted.
For example if I do git status
I get
error: bad index file sha1 signature and fatal: index file corrupt
This has happened to me several times now. I am thinking perhaps it's something to do with my dev environment. I work on a Mac and have a VMWare Virtual Machine running Debian with Apache MySQL, PHP and Git. I use Samba to connect to the vm to edit my files in my IDE. So I am thinking it has something to do with samba? Is there a better why to connect/share the work space?
The thing is I don't know how to even recreate the problem, I tried varies things to open and close edit and close, restart and what not still no luck.
But then for no reason I am aware of suddenly I get the error again. My work around at the moment is to delete the index file .git/index and do a git reset.
Anyone have any ideas?
You should check this though :) do a little
git reset --keep
. The one @VonC recommended for!Your workaround is a good one (recommended at "“Index file corrupt”").
But if samba is problematic, it would be best to get two repos: