Another git process seems to be running in this repository

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.

  • git checkout origin/master doesn't work?
  • How to 'git remote add' and track a branch in the same filesystem
  • Is the git storage model wasteful?
  • SourceTree how to reset on a already pushed commit
  • Git ignore files per branch or remote repository
  • Git: How Can I get back to my MASTER without committing?
  • Is there any way for me to fix this or should I just start a new repository?

  • Can not commit to sign with gpg2 on Windows 10 (GnuPG)
  • committing to the same branch with git
  • Azure git deployment fails on referenced .config file
  • “Error: Python not found” when trying to access the android repository
  • If I'm using Atlassian Stash, can the git repo still be managed without using Stash?
  • Git Revert On Remote
  • 5 Solutions collect form web for “Another git process seems to be running in this repository”

    try deleting .lock file in your .git directory.

    Generally such problems occurs when you execute two git commands simultaneously maybe one from command prompt and one from IDE.

    Try with this:

    rm -f ./.git/index.lock
    

    Note: Such problems may occur when you execute two git commands simultaneously maybe one from command prompt and one from IDE. So deleting .lock file in your .git directory can work.

    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
    

    Ok I ended up getting it to work by running ‘$ git rm .git/index.lock’… It’s weird because I did that a few times before to no avail but hey computers right?

    Deleting my commit message worked for me.

    rm .git/COMMIT_EDITMSG
    

    It then said.

    fatal: cannot lock ref ‘HEAD’: Unable to create ‘.git/refs/heads/[your-branch-name].lock’: File exists.

    Do notice that your branch name might be different than mine. You can delete this lock file by doing;

    rm .git/refs/heads/[your-branch-name].lock
    

    Hope this helps someone.

    Git Baby is a git and github fan, let's start git clone.