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 进程似乎正在此存储库中运行,例如
由“git commit”打开的编辑器。 请确保所有进程
被终止然后重试。 如果仍然失败,一个 git 进程
可能早先在此存储库中崩溃了:
手动删除文件以继续。
解决方法:
指 git 被另外一个程序占用,重启项目或者重新打开项目都不能解决,除非删除git源文件。
原因在于Git在使用过程中遭遇了崩溃,部分被上锁资源没有被释放导致的。
解决方案:
将本项目 .git 文件中 index.lock文件 删除
或者执行命令
rm -rf index.lock
这样就可以commit代码了!