【问题标题】:Why does Sublime block git, resulting in error: .git/index.lock exist?为什么 Sublime 会阻塞 git,导致报错:.git/index.lock 存在?
【发布时间】:2016-03-18 11:25:05
【问题描述】:

我几乎每次尝试通过 linux 终端执行 git add . 时都会收到以下消息:

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

如果我 rm 文件 index.lock 那么一切正常。这仅在 Sublime Text 打开时发生。如果我关闭程序,我可以毫无问题地通过控制台提交。

【问题讨论】:

    标签: git sublimetext2 sublimetext3


    【解决方案1】:

    删除 Sublime 中的 git 模块解决了这个问题。

    【讨论】:

      【解决方案2】:

      删除 index.lock 必须解决这个问题。

      尝试发出del .git\index.lock

      【讨论】:

      • linux上的rm和windows上的del不是一回事吗?
      • 是的,它们都是一样的。
      猜你喜欢
      • 2012-08-04
      • 2016-08-06
      • 1970-01-01
      • 2011-12-13
      • 2016-08-09
      • 2011-12-01
      • 2013-05-12
      • 1970-01-01
      • 2012-12-09
      相关资源
      最近更新 更多