9

I'm stuck... If I do git stash I get:

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

After manually removing index.lock, I get:

Rename from .git/index.lock to .git/index failed. Should I try again? (y/n)

git checkout master:

 Rename from .git/index.lock to .git/index failed. Should I try again? (y/n)

git commit via GitHub:

Unable to create a new commit

What can I do?

luqita
  • 4,008
  • 13
  • 60
  • 93

3 Answers3

18

Solved it using the universal fix for all software problems: restarted the computer.

luqita
  • 4,008
  • 13
  • 60
  • 93
4

It happens sometime to me on Windows.

Solution is simple: close Explorer windows.

Hartok
  • 2,147
  • 20
  • 37
3

A process certainly had the file locked. You can use Process Explorer from the SysInternals Suite to find which one : enter part of the path in > Find > Find Handle or Dll.... Most of the time, there's no need to restart your computer, it can be as easy as closing an Explorer.exe window.

diapir
  • 2,872
  • 1
  • 19
  • 26