git提交出现Another git process seems to be running in this repository, e.g. an editor opened by ....

报错信息:

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 commit”指令,请关闭所有git相关的进程重试,否则,请手动删除那个文件。

由于windows对于进程的同步互斥管理,是有资源上锁机制的。猜测这里肯定是有进程对某资源进行了加锁,但是由于进程突然崩溃,未来得及解锁,资源未被释放,导致其他进程访问不了

解决方法:

进入项目文件夹下的 .git文件中(显示隐藏文件夹或rm .git/index.lock)删除index.lock文件即可。

 

posted @ 2021-08-04 18:05  习久性成  阅读(503)  评论(0编辑  收藏  举报