.git / index.lock is constantly displayed repeatedly

When I try to run any git command, I get the following

$ git add .
 fatal: Unable to create 'J:/Project/geospatial/U5M_africa/.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 delete the file without errors:

$ rm -f .git/index.lock

I am also trying to remove this manually in windows. The file disappears, but appears again. If I try any git commands, I still get the same fatal error.

What causes an immediate redisplay of a file? How can I get rid of him forever and continue my life?

+4
source share
3 answers

My not-so-elegant but effective solution:

Rename the file first and then delete it. For some reason this works.

+2
source

Check your processes ( process explorer : CTRL+ F: search J:\Project\geospatial\U5M_africa)

git .
git gui , "git index.lock , , "

0

@VonC, - "" git .

pull or push .

- , , .


:

git, , . , , .

If another git process is not currently running, this probably means the git process crashed in this repository before.

Make sure the other git process is running and deleting the file manually in order to continue.

The solution is very simple, just delete the file .git/index.lock

rm .../.git/index.lock
0
source

Source: https://habr.com/ru/post/1623631/


All Articles