8

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.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Desert Rose
  • 3,376
  • 1
  • 30
  • 36
  • this may halp's u http://stackoverflow.com/questions/9282632/git-index-lock-file-exists-when-i-try-to-commit-but-cannot-delete-the-file – Nitin Gohel May 17 '13 at 06:17
  • I tried everything,but same result. – Desert Rose May 17 '13 at 06:31
  • Check to see where you are issuing the command at. It should be issued at the root where you issued "git init" – shaytac Jan 02 '14 at 16:22
  • Possible duplicate of [Git - fatal: Unable to create '/path/my\_project/.git/index.lock': File exists.](http://stackoverflow.com/questions/7860751/git-fatal-unable-to-create-path-my-project-git-index-lock-file-exists) – Kristján Dec 04 '15 at 15:56

4 Answers4

18

Try

rm -f ./.git/index.lock

In your repository directory.

Deepesh Gairola
  • 1,252
  • 12
  • 18
1

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.

bonsak
  • 11
  • 1
  • 3
0

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

Laura
  • 1
0

Inside your project folder, go to git folder and remove index.lock file.

Muhammad Awais
  • 4,238
  • 1
  • 42
  • 37