Pt. 2 Back Tracking - 6. Git Reset II


#1

I keep getting this error whenever I type in git reset.

Any help is appreciated.


#2

Git has already suggested something, did you read that?


#3

Yea I just started this up after taking a break for a while so I have no idea how to close down other processes.


#4

Do you have knowledge of that there are any other processes? Otherwise, it suggests how to fix it.


#5

I do not know of any other processes and what you see in the screenshot is all it tells me.


#6

So you're saying that there aren't any git processes running. It says to make sure of that, and then to do something else


#7

How do I make sure of that? I don't see any other processes.


#8

You said you haven't quit while it was running and that it hasn't crashed on you.

The lock file is essentially saying that git is running somewhere, but you will not be able to tell for certain because there might be another machine that's doing it and you can't search the processes of all machines that might be using that file system.

You can check your own:
pgrep -a git
But that seems unlikely if you can't remember having quit while git was running, and even if it is running, it could be doing so on another machine, doubly unlikely.

Just delete it. Worst case you'll have to reset, but most likely not.


#9

Sorry I'm being so dumb, but how would I delete it?


#10

There's a program, or perhaps a built-in command in bash, by the name rm, so you would run rm with the file to remove as the argument

(I'd rather have you put the full command together by first having understood what it is you're entering than giving you something to paste in)


#11

$ git rm /home/ccuser/workspace/hamlet-prince-of-denmark/.git/index.lock

I tried this and it seems like it should work, but it give me the same error I keep getting (the one in the screenshot).


#12

Well. Git does actually have its own rm too. But the program you are invoking there is git, not rm


#13

Thanks so much, it worked! And now I know how to remove files.