有时候在提交的时候,中间提交出错,导致有文件被lock,所以会报下面的错误:
fatal: Unable to create ‘/msg/.git/index.lock’: File exists.
If no other git process is currently running, this probably means a git process crashed in this repository earlier. Make sure no other git process is running and remove the file manually to continue.
出现这种情况可以用以下解决办法:
试着删除 index.lock
1、命令行代码 rm -f ./msg/.git/index.lock
2、直接去文件系统进行删除该lock文件
本文介绍了一种常见的Git操作中遇到的问题——提交过程中产生的锁文件导致无法继续提交,并提供了两种有效的解决方案:通过命令行删除锁文件或直接在文件系统中手动删除。
1万+

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



