5. git reset: git process crashed, need to remove file manually...but how?


#1

I got interrupted during this exercise and when I returned I had to restart. Now I get the following error message (I tried using "rm" to remove the file, but the same error message appears, as follows:)

$ git rm scene-2.txt -f
fatal: Unable to create '/home/ccuser/workspace/hamlet-prince-of-denmark/.git/index.lock': File e
xists.

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.
$

How do I "manually remove the file?" Here's what my screen looks like:

https://gyazo.com/5e66c624ea124632d9387d66b2122bc6


#2

You tried to ask git to remove it, git is busy refusing to run and that's not one of your staged files anyway. Use rm. Not git.

Also if you wish to check if git is running you can do so with pgrep -a git, but then again you might not even be in the same container any more/doesn't matter. Also, more likely is that git was killed while doing something, such as by the container logging off/powering off. It doesn't say that git did crash, you added that (be careful with that as you may make bad assumptions that way)


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.