Loading ...

Git error: bad index file sha1 signature fatal: index file corrupt | CodeAsp.Net

Git error: bad index file sha1 signature fatal: index file corrupt

 /5
0 (0votes)

Sometimes using Visual Studio Git Extensions, while switching in and out of Git branches, you may encounter this error:

error: bad index file sha1 signature
fatal: index file corrupt

Your Git index may get corrupted, and here is a quick fix to restore your index to your last commit:

1. Open Git bash by going to Start-> All Programs-> Git-> Git Bash. This will open up the Git bash command prompt window.

2. Go to your local repository folder (using cd c:\>path to my repository )

3. Type: $ rm -f .git/index

4. Then type: $ git reset

Now your index is re-loaded to your last commit. You may want to check your commits again and push/pull changes to that branch just to bring it uptodate.

 

Comments (no comments yet)

Top Posts