一 报错:fatal: Unable to create ‘xx/.git/index.lock’: File exis
如下:
$ git commit
fatal: Unable to create 'xx/.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.
二 解决方案
1 资源管理器

2 命令
进入到项目目录根处,即报错’xx/.git/index.lock’中的xx路径,输入以下指令。
$ rm .git/index.lock
ps:git rm访问不到xx/.git,不会生效。
本文介绍了如何处理Git commit时遇到的'.git/index.lock'文件已存在错误,通过资源管理器或命令行操作进行解锁,并提供了两种解决方案。

被折叠的 条评论
为什么被折叠?



