【问题标题】:Aptana fatal: Unable to create '.git/index.lock': File existsAptana 致命:无法创建“.git/index.lock”:文件存在
【发布时间】:2012-12-09 04:07:41
【问题描述】:

我正在使用 Aptana Studio 3,构建:3.3.1.201212171919 和 GIT。使用一段时间后,我注意到在执行 GIT 操作时,Aptana 会不断刷新我的工作区,这反过来又会一次锁定我的 GIT 存储库几分钟。如果我尝试在 Aptana 刷新时执行任何需要锁定索引文件的 GIT 操作,我会得到以下信息

fatal: Unable to create 'c:/wamp/www/website/.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.

我在这里与他们创建了一张票 https://jira.appcelerator.org/browse/APSTUD-7603

有没有人找到一种方法来防止这种情况发生/花费这么长时间/不创建锁

编辑

我至少能够暂时解决这个问题。在使用 GIT 的 repo 中的“App Explorer”下时。点击蓝色齿轮。在下拉菜单中悬停“更多”单击“断开连接”,这将阻止 Aptana 监视 GIT 存储库的更改。 GIT 仍然可以工作,但我不再让 Aptana 尝试刷新我的工作区,并且在视觉上文件树将不再显示更改。

编辑 2

对 index.lock 文件执行rm 不会解决此问题。我的问题是,当 Aptana 构建工作区时,它会不断为其 GIT 操作所需的进程创建和删除 index.lock 文件。如果我查看 .git 文件夹,我可以看到 Aptana 创建和删除了 index.lock 文件。一旦 Aptana 完成,index.lock 文件就消失了,我可以正常执行操作,因此无需删除它。

【问题讨论】:

    标签: git aptana aptana3


    【解决方案1】:

    我也有同样的问题。

    唯一的解决方案是运行两次 Git 命令。然后锁定文件被解锁

    【讨论】:

    • 这对我不起作用。无论我尝试运行多少次命令,我的有时都会被锁定 5 分钟。随机我将能够在刷新之间潜入,我的命令将运行。
    【解决方案2】:

    如果您仍然遇到此问题,请尝试

    rm c:/wamp/www/website/.git/index.lock

    它对我有用。

    【讨论】:

    • 这不会解决我的问题。我的问题是,当 Aptana 构建工作区时,它会不断为其 GIT 操作所需的进程创建和删除 index.lock 文件。如果我查看 .git 文件夹,我可以看到 Aptana 创建和删除了 index.lock 文件。一旦 Aptana 完成,index.lock 文件就消失了,我可以正常执行操作,因此无需删除它。
    【解决方案3】:

    试试rm -f ./.git/index.lock,因为在极少数情况下 git 崩溃了……这个文件被劫持了。

    【讨论】:

    • 不...见评论here
    猜你喜欢
    • 2013-05-12
    • 2011-12-13
    • 1970-01-01
    • 2016-09-02
    • 2012-08-04
    • 2019-07-11
    • 1970-01-01
    • 1970-01-01
    • 2022-01-22
    相关资源
    最近更新 更多