I have the following situation: master is 2 behind on origin master
How I got in this situation: By firstly applying 'Reset master to this commit' in Sourcetree. But then I realised I should have reversed the pushed commits How to rollback everything to previous commit. That's what I did afterwards. As I am pretty new to Git, to test out, I pulled the 2 unwanted commits, realised again I didn't want them, and then redid the above again except for the pulling. I tried to reverse the two unwanted commits again but I was only able to reverse one and got the following message:
fatal: Unable to create '/Users//.git/index.lock': File exists. Another git process seems to be running in this repository, e.g. an editor opened by 'git commit'. Please make sure all processes are terminated then try again. If it still fails, a git process may have crashed in this repository earlier: remove the file manually to continue.
I tried to reset the origin/master to my local master pointer. Following Git, How to reset origin/master to a commit?, this needs to be done
git checkout master
git reset --hard e3f1e37
git push --force origin master
When I do git checkout master
I get the same message again.
Even if I want to pull or stage file for the next commits I get the same message.
So imo there's no other git process running. It's definitely possible that a git process is crashed with all my try outs and the (Unity) application running on the repository. But which file to remove manually? How to find it?
I solely use this repository. So I wouldn't mind a drastic solution as long as I have a clean copy to work on again. Because now with every git action I do, I get the above message.
EDIT: The solution is the same as mentioned in the possible duplicate link. The situation that produced the error not. I,for example, and only ET knows why, didn't look up the error message. Maybe there will be others that come across this particular situation. So is it a duplicate or not? Please tell me.