2013-05-17 25 views
7

當我嘗試重命名我的Xcode Project中的任何圖像名稱時,它會產生以下錯誤。致命:無法創建'/.git/index.lock':文件存在

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

不知道什麼錯誤。 在此先感謝。

+0

這可能HALP的ühttp://stackoverflow.com/questions/9282632/git-index-lock-file-exists-當我嘗試提交但不能刪除文件 –

+0

我嘗試了一切,但結果相同。 –

+0

檢查以查看您在哪裏發佈命令。它應該在你發出「git init」的根目錄發佈 – shaytac

回答

13

嘗試

rm -f ./.git/index.lock 

在您的倉庫目錄。

+2

沒有成功。顯示錯誤消息。 –

+0

@DesertRose嘗試'rm .git/index.lock' – KNU

+0

@Deepesh Gairola爲我工作! – oshingc

1

我在osx上由Mamp託管的Wordpress插件文件夾內有本地回購。本地服務器的權限在Mamp權限設置中設置爲「www」。我將權限更改回給我,並且「/index.lock」需要手動刪除。「 - 問題消失了。

0

對於我來說,$ RM index.lock而在我的git倉庫也解決了這個問題