error: bad signature 0x00000000
问题描述
今天在写git commit
的时候,电脑突然蓝屏了,重启后输入git status
显示如下错误信息1
2
3
4lan@DESKTOP-8ISAT6B MINGW64 /e/Blog/blogRoot (src)
git status
error: bad signature 0x00000000
fatal: index file corrupt
解决方案
先删除index1
rm -f .git/index
然后再重新创建index1
git reset
运行效果:1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19lan@DESKTOP-8ISAT6B MINGW64 /e/Blog/blogRoot (src)
$ rm -f .git/index
lan@DESKTOP-8ISAT6B MINGW64 /e/Blog/blogRoot (src)
$ git reset
Unstaged changes after reset:
M source/lover/index.md
M source/todo/index.md
lan@DESKTOP-8ISAT6B MINGW64 /e/Blog/blogRoot (src)
$ git status
On branch src
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: source/lover/index.md
modified: source/todo/index.md
no changes added to commit (use "git add" and/or "git commit -a")
参考资料
https://www.cnblogs.com/linga/p/10214955.html
https://www.jianshu.com/p/58f306f0b8c5