【发布时间】:2016-04-28 10:59:35
【问题描述】:
我最近开始使用 Cloud9 IDE。我使用 Git 作为版本控制,它工作正常,直到最近我尝试了这个命令:
git add .
它失败并出现以下错误:
ubuntu:~/workspace (master) $ git add .
fatal: Unable to create '/home/ubuntu/workspace/.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.
ubuntu:~/workspace (master) $
我确实拥有sudo 权限,并且将sudo 与上述命令一起使用会给我带来其他错误。索引不会更新。它仍然显示我喜欢修改,但没有添加。
疯狂的部分是,该文件 .git/index.lock 不存在,而且当我尝试使用 top 或 ps grep 查找是否有任何 git 进程在后台运行时,我不能随便找。
我在 Cloud9 环境中使用 Ubuntu 14.04 LTS。我是拥有 RW 权限的合作者之一,但我没有重启权限。我尝试了以下方法,但它们不起作用:
sudo reboot
sudo shutdown -r now
请让我知道如何进行。我需要尽快部署代码。顺便说一句,这是我的第一篇文章,我也在这里看到过类似的帖子:
【问题讨论】:
-
可以手动进入目录查看文件吗?并使用
sudo rm -f index.lock删除?它通常是隐藏的。 -
@PraveenKumar 否。该位置根本不存在该文件。
-
您可以尝试使用
ls -la或类似的过滤器吗? -
可能是权限错误。尝试运行 sudo chown -R
. -
@TomRees 我有
sudo权限。
标签: git cloud9-ide