Are you first timer at lazacode.org? Why not join us and start exchange your programming knowledge with everyone. Register today!

Git - git status shows 'bad signature 0x00000000, index file corrupt'

0 votes
20 views
added Mar 11 in Git by lcjr Second Warrant Officer (4,220 points)
edited Mar 23 by lcjr

If the problem is with the index as the staging area for commits (i.e. .git/index), you can simply remove the index (make a backup copy if you want), and then restore index to version in the last commit: 

rm -f .git/index
git reset
git add .
git commit -m "git fix message here"

-------------------------------------------------------------

If that not work, can try this second method.

How? Go to <YOUR_PROJECT_FOLDER>\.git\refs\heads\ and delete the problematic branch from the directory.

Delete .git\refs\heads\<YOUR_BRANCH_NAME> 

Followed by reset and commit the files, as showed in the following commands

git reset
git add .
git commit -m "git fix message here"

 

--------

The issue of " You are on a branch yet to be born " can be fixed with second method too. 

 

Please log in or register to response this reference.

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...