【git error|SourceTree】error: bad signature 0x00000000 fatal: index file corrupt

Report an error

error: bad signature 0x00000000
fatal: index file corrupt

Scenes

When using git add . to submit code to the buffer or using SourceTree, the computer crashes. This prompt will appear after restarting and submitting the code again

Cause Analysis

The index file in the .git directory is damaged

Solution

//delete index file
rm -f .git/index

//Roll back to the version without added buffer
git reset

Guess you like

Origin blog.csdn.net/qq_37215621/article/details/134625903