fatal: Unable to create ‘xxx/.git/index.lock‘: File exists.
index.lock 产生原因:在你进行某些比较费时的 git 操作时自动生成,操作结束后自动删除,相当于一个锁定文件,目的在于防止对一个目录同时进行多个操作。报错原因:在 git 没有运行完的时候强制关闭,index.lock没有被自动删除,下次提交就会产生此错误。× git add found some errors. Please fix them and try committing ag
·
index.lock 产生原因:
在你进行某些比较费时的 git 操作时自动生成,操作结束后自动删除,相当于一个锁定文件,目的在于防止对一个目录同时进行多个操作。
报错原因:
在 git 没有运行完的时候强制关闭,index.lock 没有被自动删除,下次提交就会产生此错误。
× git add found some errors. Please fix them and try committing again.
fatal: Unable to create 'xxx/.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.
解决办法:
手动删除 index.lock
我们看不见 .git 文件,直接用命令删除即可:
rm -f .git/index.lock
更多推荐
所有评论(0)