fatal: Unable to create '/.git/index.lock': File exists

99封情书 提交于 2019-12-09 17:35:16

问题


When I try to rename any image name in my Xcode Project it gives following error.

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.

Don't know what is going wrong. Thanks in Advance.


回答1:


Try

rm -f ./.git/index.lock

In your repository directory.




回答2:


I had my local repo inside a Wordpress plugin folder hosted by Mamp on osx. The permissions for the local server was set to "www" in the Mamp permission settings. I changed the permissions back to me, and the "/index.lock“ needs to be removed manually."-problem went away.




回答3:


For me, $rm index.lock while in my git repository also solved the problem



来源:https://stackoverflow.com/questions/16602544/fatal-unable-to-create-git-index-lock-file-exists

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!