美文网首页
458.【Git】解决:E:/**/.git/index.loc

458.【Git】解决:E:/**/.git/index.loc

作者: 七镜 | 来源:发表于2022-10-15 20:53 被阅读0次

    今天提交代码时遇到了一个问题,导致我提交不了代码到gitlab上,报错如下所示:

                19:59   Commit failed with error
                0 file committed, 4 files failed to commit: after guoqing
                Unable to create 'E:/company/workspace_database/update_jar/.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.
    

    遇到这个问题,直接去把 E:/company/workspace_database/update_jar/.git/index.lock 删了,就解决了。其实这是 git 为了避免多进程同时提交上的一个锁。和linux里,我们使用 vim 编辑器时,会自动生成一个.swap文件一样的。

    可见,原理都一样,但换了个场景,就不知道咋回事了,值得反思。

    相关文章

      网友评论

          本文标题:458.【Git】解决:E:/**/.git/index.loc

          本文链接:https://www.haomeiwen.com/subject/lpdkzrtx.html