Why " '/path/to/repo/.git/index.lock': File exists" issue happened?
I don't know what happened to my system because from last week it is giving this error continuously 2-3 times on daily basis.
fatal: Unable to create '/path/to/repo/.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.
I have remove this is file every time and currently it became a big pain for me.
Can anybody explain why it is happening continuously or what are its expected causes/reasons or anything that can help me to avoid this thing, at least on daily bases it should not happen.
I've seen this happen several times in the office.
Basically, what happened here was - a git console command was inputted, while at the same time a visual client was running some command on its own. In the end both fail to delete the index.lock file, without any other side effects of problems caused.
I usually just deleted my original index file and replaced it with the index.lock version just in case.