Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Another git process seems to be running in this repository

Tags:

git

I'm trying to learn how to use Git and have created a small project with an HTML, CSS, and Javascript file. I made a branch from my basically empty project and then made some changes to my code. I tried staging the changes but I get the following error 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. 

Granted, I did run into problems trying to commit my empty project earlier and just quit git bash since I didn't know how to get out of where I somehow had gotten.

Is there any way for me to fix this or should I just start a new repository?

like image 331
Matt Corby Avatar asked Jun 24 '16 00:06

Matt Corby


People also ask

How do you stop a git run?

If you are using the git cli directly, pressing q in the keyboard will also do the job for you. Show activity on this post. ctrl + c is the most used task killing command for command based working windows.

Why is git add taking so long?

Git slowness is generally from large binary files. This isn't because they're binary, just because binary files tend to be large and more complex to compress & diff. Based on your edit indicating the file sizes, I suspect this is your problem.

What is git lock?

When you perform a Git command that edits the index, Git creates a new index. lock file, writes the changes, and then renames the file. The index. lock file indicates to other Git processes that the repository is locked for editing.


2 Answers

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.

like image 165
Rohit Shedage Avatar answered Sep 23 '22 17:09

Rohit Shedage


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 
like image 38
M.J Avatar answered Sep 23 '22 17:09

M.J