AlexUA
AlexUA

Reputation: 747

Can't commit - '.git/index.lock': File exists. Even though, there is no file like that

Getting an error when trying to commit and push:

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.

What I tried:

  1. finding that file and deleting it - there is no file index.lock in this repo. It is not there, neither in the .git folder nor in git/refs/head/my_branch (yes, hidden files are shown, yes I tried through sudo).
  2. completely delete the repo and clone it once again, and then committing.
  3. kill all of the git processes.
  4. hard reset of computer.
  5. rm .git/COMMIT_EDITMSG - no such file

No result.

Upvotes: 0

Views: 120

Answers (1)

AlexUA
AlexUA

Reputation: 747

the error has nothing to do with the real cause of the problem. Spend time "fighting" with what I am not suppose to "fight" at all, lol.

I did ga . & gcmsg "updated" && gp instead of ga . && gcmsg "updated" && gp 🤣

Maybe will be helpful for someone.

Upvotes: 1

Related Questions