git error on all repositories, pre-existing and brand new (error: bad index file sha1 signature fatal: index file corrupt)

112 views Asked by At

I have a problem where if a try to commit changes on any git repository I get the error:

error: bad index file sha1 signature

fatal: index file corrupt

This happens on any repo I try, both existing repos that previously worked fine and brand new ones created for the purpose of trying to find out what is going on.

The only time the error is not generated is if I commit an empty repository.

I have tried:

rm -f .git/index

git reset

as suggested in many posts but this has no effect.

I am running git in a virtual machine (Ubuntu 16.04.3).

When running git on the the host OS (macOS Sierra 10.12.6) there is no problem. I can use git as normal.

Any suggestions for what I can do in order to be able commit from within the Ubuntu VM again would be hugely appreciated!

Thanks!

0

There are 0 answers