V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
thinkershare
V2EX  ›  问与答

Git 仓库,总是出现一个奇怪的错误: .git/index.lock File exists., 是什么故障呢?

  •  
  •   thinkershare · 99 天前 · 603 次点击
    这是一个创建于 99 天前的主题,其中的信息可能已经有所发展或是发生改变。

    我有一个 Git 仓库,同步到了 GitHub 和和自建的 GitLab 上,这个仓库最近频繁的在多台电脑上出现相同的错误:

    fatal: Unable to create 'xxx/.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.

    我已经尝试将仓库删除,重新 clone ,在不同的机器上,这个问题还是仿佛出现,每次删除掉 index.lock 提交成功,并 pull/push 后,下次使用 vscode 编辑代码后,再次 commit,又会出现一样的错误。

    3 条回复    2024-01-24 17:30:48 +08:00
    whileFalse
        1
    whileFalse  
       99 天前 via Android
    可能是两个 git 在同时操作这个 repo ,比如 vscode 插件自动刷新的时候你手动 commit
    XXWHCA
        2
    XXWHCA  
       99 天前
    盲猜装了多个 git
    thinkershare
        3
    thinkershare  
    OP
       99 天前
    @whileFalse
    主要是就这一个仓库有问题,奇了怪了。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2266 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 08:02 · PVG 16:02 · LAX 01:02 · JFK 04:02
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.