Reputation: 649
I was committing my git process and thought that it would be okay if I ignore comments so I used this code
git commit filename
Bash was strange and thus i closed the console now when I use proper command
git commit -m"THIRD COMMIT" filename
It give the following response:
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:
what should I do?
Upvotes: 18
Views: 66884
Reputation: 11
In my case, i opened Git Bash (on windows) and run this command rm .git/index.lock after can use git add whith normaly
Upvotes: 0
Reputation: 518
In case you stopped the rebase before it was finished you can run this command on the git bash on the .git folder:
rm REBASE_HEAD.lock
Upvotes: 0
Reputation: 5
The commands didn't seem to work for me so I navigated to the root folder of my project, viewed hidden files, then navigated to .git/ to delete index.lock, I rerun git commit -m"THIRD COMMIT" filename and that was it!
Upvotes: 0
Reputation: 33
check .gitignore files . When I tried to find the error I found and fixed it.
Upvotes: -2
Reputation: 351
I have same faced issues when i tried to staged file in SourceTree.
To solve this go to the .git folder in the project directory and manually delete index.lock and you are done.
Upvotes: 0
Reputation: 79
Upvotes: 4
Reputation: 21
This helps to avoid the below message "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."
Even in windows when I tried deleting the index.lock file, the git reset --hard HEAD command was executing without any hindrance.
del index.lock git reset --hard HEAD
Previously when I was running the checkout process inside this repository , I had to disconnect in middle of the process. So this might be the cause for this issue.
Upvotes: 2
Reputation: 2106
It happened for me when I run pull from GIT command and got conflicts and try to revert them by the TortoiseGIT client. I resolved this by running below code at root folder level of my repo
rm .git/index.lock
Hope this is helpful.
Upvotes: 1
Reputation: 456
I met this problem recently too.
rm -f ./.git/index.lock
try this commend in your git bash, then you can solve your problem.
Upvotes: 44
Reputation: 806
Removing the index.lock
like it was recommended in this answer of another question should solve your problem.
Upvotes: 8