Ayush Mahajan
Ayush Mahajan

Reputation: 649

Another git process seems to be running and thus cant commit

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

Answers (10)

webklazz
webklazz

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

Kevin Oswaldo
Kevin Oswaldo

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

Nathan Sodja
Nathan Sodja

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

Salih Kiraz
Salih Kiraz

Reputation: 33

check .gitignore files . When I tried to find the error I found and fixed it.

Upvotes: -2

Rokan Nashp
Rokan Nashp

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

devendra
devendra

Reputation: 79

  1. In windows, change settings to view hidden folders
  2. Navigate inside .git folder
  3. Manually delete .lock file

Upvotes: 4

user8526130
user8526130

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

dush88c
dush88c

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

liuguangsen0409
liuguangsen0409

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

Gersee
Gersee

Reputation: 806

Removing the index.lock like it was recommended in this answer of another question should solve your problem.

Upvotes: 8

Related Questions