今天git add的时候出现错误bad signature fatal: index file corrupt
之后就是无论如何也commmit不了也push不了
在网上找了方法如下:
在项目有.git这同级打开Git Bash Here
- 输入
$ rm -f .git/index
出现
ssss@DESKTOP-ssssMINGW64 /e/project/ssss(master) - 再输入
$ git reset
但是在执行$ rm -f .git/index的时候,显示
bash: rm-f.git/index: No such file or directory
然后再输入$ git reset,自然是没有成功
后来自己在项目的.git文件中手动删除了index文件
再执行$ git reset显示:
$ git reset
fatal: Unable to create 'C:/Users/lenovo/Desktop/test/hw11/.git/index.lock': File exists.
Another git process seems to be running in this repository, e.g.
an editor opened by 'git commit'. Please make sure all processes
are terminated then try again. If it still fails, a git process
may have crashed in this repository earlier:
remove the file manually to continue.
又接着在.git文件中手