GIT:/.git/index.lock':文件存在

slu*_*dog 16 git

我和我的一个git repos有一个问题.我一直收到以下错误:

    fatal: Unable to create 'v:/path/to/files/.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.
Run Code Online (Sandbox Code Playgroud)

我已经尝试过:rm -f ./.git/index.lock根据stackoverflow上的另一个线程但我每次都会收到此错误:rm:无法取消链接`./.git/index.lock':权限被拒绝

当我关闭aptana(我在终端中使用git)时,我无法删除文件.

任何想法如何解决这个问题?

另外需要注意的是,当我偶尔在其中进行提交时,这个git repo非常慢(它允许我每10次尝试一次)

谢谢

Chr*_*her 26

Sudo命令:

sudo rm -f ./.git/index.lock
Run Code Online (Sandbox Code Playgroud)

这两个错误建议index.lock由另一个用户拥有.rm以超级用户身份运行,然后再次尝试命令.您也可以考虑设置core.sharedRepository为,true如果这是您的回购的情况:

core.sharedRepository

当group(或true)时,存储库可以在组中的多个用户之间共享(确保所有文件和对象都是可写组的).

当所有(或世界或所有人),所有用户都可以读取存储库,此外还可以进行组共享.当umask(或false)时,git将使用umask(2)报告的权限.当0xxx,其中0xxx是八进制数时,存储库中的文件将具有此模式值.0xxx将覆盖用户的umask值(而其他选项将仅覆盖用户的umask值的请求部分).示例:0660将使所有者和组可以读取/写入,但是其他人无法访问(相当于组,除非umask是例如0022).0640是一个可读组但不可写组的存储库.

请参阅git-init(1).

默认为False.


slu*_*dog 4

问题最终是 Aptana,每次我运行此命令时,当我尝试在 git 中提交时,都会导致此错误。

我停止使用 aptana studio,不再有这个问题。