I use an Ubuntu VM over Windows 8 using VMWare and while using git I got an error of
error: bad index file sha1 signature
fatal: index file corrupt
When trying to commit
.
Now, I found ways to fix this (the primary one, deleting .git/index
and retrying, seems a bit of a workaround) but I want to understand what causes this error (Partly because they tend to work in a random way).
I made an experiment and run a couple of commands in ~/
(a regular directory) and in /mnt/hgfs/Shared with host/
(the shared directory with the Windows host, which is my laptop).
In the regular directory it worked flawlessly, but in the shared directory it failed with the above error on the commit message.
The commands are:
mkdir trial
cd trial
echo hello > world.txt
git init
git add .
git commit -m "msg"
Now I wonder, why does it matter that the directory is shared?
And in general, what causes this error? Which sha1 signature is the index file compared to (I didn't find anything that could store such a signature when running tree .git
)?