Programmers learn & share
+1 vote
90 views

Problem :

I need solution for bellow GIT error
another git process seems to be running in this repository, e.g. an editor opened by 'git commit'.
by (6.9k points)   | 90 views

2 Answers

0 votes

Solution :

Please use following command in case you are facing 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 after that try again. If it still fails, a git process may have crashed in this repository earlier: remove the file manually to continue.

rm -f .git/index.lock

git reset 

and after reset command use 

git status, git add, and git commit -a or git commit -m "your message", git push origin master.

by (36.1k points)  
0 votes

Solution:

Try deleting index.lock file in your .git directory.
rm -f .git/index.lock

Such problems generally occur when you execute two git commands simultaneously; maybe one from the command prompt and one from an IDE.

Use the below command in the root directory of the application. This will delete the index.lock file and release the active lock.

rm .git/index.lock

Deleting my commit message worked for me.

rm .git/COMMIT_EDITMSG

It is similar to above methods but in my case I had several of those

.git/refs/heads/<branch_name>.lock

and was able to remove all at once by this way

find -name "*.lock" -exec xargs rm {} \;

If you are using CocoaPods and at some point botched an update or install (manually killed it or something), try

1) Removing the index.lock file (in .git/index.lock)

2) Remove your Podfile.lock file.

3) Do a new pod update

4) Try issuing the git command that was failing (in my case it was a git add .)

If you are windows user there will be error 'rm' is not recognized as an internal or external command. That's because rm is a Linux command. So in windows, you can use below to remove the index.lock file inside .git folder

del -f .git/index.lock
rm -f ./.git/index.lock

To fix:

rm -f .git/index.lock

 

 

ago by (5.5k points)  
2,187 questions
2,514 answers
59 comments
241 users