Nwarie Benson
Nwarie Benson

Reputation: 31

How to resolve .git/index.lock: File exists

I am trying to push a project to Github using gitbash. I have already committed some changes to the project but not on my local computer but directly on the Github website. Now I am trying to push an update of the project from my computer and I am getting error messages

$ git add
fatal: Unable to create 'C:/Users/JJ/.git/index.lock': File exists.


Another git process seems to be running in this repository, e.g.
an editor opened by 'git commit'. Please make sure all processes
are terminated then try again. If it still fails, a git process
may have crashed in this repository earlier:
remove the file manually to continue.

Upvotes: 3

Views: 14158

Answers (1)

user12577046
user12577046

Reputation:

When I faced the same problem. I found a solution and it is
rm -f ./.git/index.lock
Please, try it.
Thank you...

Upvotes: 3

Related Questions