3

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.
Daemon Painter
  • 3,208
  • 3
  • 29
  • 44
Nwarie Benson
  • 31
  • 1
  • 1
  • 4
  • The error is coming from the add, not the push . `An editor opened by git commit`: I believe this is telling you that you left a process open (e.g vim) when you were editing the commit message of a certain commit. What editor do you normally use for the messages? And if it is vim, how did you close it? – Paolo Aug 29 '19 at 14:08
  • possible duplicate: https://stackoverflow.com/questions/7860751/git-fatal-unable-to-create-path-my-project-git-index-lock-file-exists – Daemon Painter Aug 29 '19 at 14:47
  • Possible duplicate of [Git - fatal: Unable to create '/path/my\_project/.git/index.lock': File exists](https://stackoverflow.com/questions/7860751/git-fatal-unable-to-create-path-my-project-git-index-lock-file-exists) – Daemon Painter Aug 29 '19 at 14:47

1 Answers1

3

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