jesseduffield / lazygit

simple terminal UI for git commands
MIT License
52.65k stars 1.84k forks source link

fatal: Unable to create `../index.lock`: File exists. #2050

Open Dich0tomy opened 2 years ago

Dich0tomy commented 2 years ago

For some time now lazygit seems to bug all the time. I'm 100% sure that there are no other programs running in the background that could do some git operations.

I try to open lazygit from the terminal, but everytime I try to do any operation after that I get the error about the git lock. So I remove it by hand rm -rf .git/index.lock and get back to lazygit, same thing.

It doesn't matter if I do this from bare console or from the console inside neovim. Sometimes after deleting the index.lock file and getting back it works fine, only to complain again a usage later.

If I remove the file manually and then use git commands instead of using lazygit, everything works fine.

image

Windows, but I'm on WSL2 kali-linux Linux stacjonarny 5.4.72-microsoft-standard-WSL2 #1 SMP Wed Oct 28 23:40:43 UTC 2020 x86_64 GNU/Linux Lazygit version 0.34

snoopdouglas commented 1 month ago

I get this issue when I power down while lazygit is still open (but idle) - so I get the feeling that SIGTERM isn't resulting in the removal of the lock.

Edit 2024-10-26: I've now confirmed this is simply happening inbetween invocations of lazygit. I'm not even doing anything particularly speedily (that I'd have suspected would be causing race conditions with the lock). This is making lazygit pretty tedious to use.