Git 添加问题
Issue with Git Add
我最近开始使用 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
不存在,而且当我试图在后台查找是否有任何 git
个进程 运行 时,使用 top
或 ps grep
,我找不到。
我在 Cloud9 环境中使用 Ubuntu 14.04 LTS。我是具有 RW 权限的协作者之一,但我没有重启权限。我尝试了以下但它们不起作用:
sudo reboot
sudo shutdown -r now
请告诉我如何进行。我需要尽快部署代码。顺便说一句,这是我的第一个post,而且我在这里也看到过类似的post:
- Stuck on Git on Windows: Can't checkout, can't stash, can't commit
- fatal: Unable to create '/.git/index.lock': File exists
尝试使用:
sudo chmod 755 -R .git
sudo chown -R ubuntu:root .git
如果文件不存在,则为真。对我来说似乎是权限问题。
我最近开始使用 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
不存在,而且当我试图在后台查找是否有任何 git
个进程 运行 时,使用 top
或 ps grep
,我找不到。
我在 Cloud9 环境中使用 Ubuntu 14.04 LTS。我是具有 RW 权限的协作者之一,但我没有重启权限。我尝试了以下但它们不起作用:
sudo reboot
sudo shutdown -r now
请告诉我如何进行。我需要尽快部署代码。顺便说一句,这是我的第一个post,而且我在这里也看到过类似的post:
- Stuck on Git on Windows: Can't checkout, can't stash, can't commit
- fatal: Unable to create '/.git/index.lock': File exists
尝试使用:
sudo chmod 755 -R .git
sudo chown -R ubuntu:root .git
如果文件不存在,则为真。对我来说似乎是权限问题。