Another git process seems to be running in this repository
Sep 6, 2018 · 1 min read
Today I ran into an error when I was trying to switch branches from master to a feature branch using Git.
The error said:
fatal: Unable to create ‘/Users/farooqyousuf/workspace/idme_apps/idme-revelator/.git/index.lock’: File exists.Another git process seems to be running in this repository, e.g.an editor opened by ‘git commit’. Please make sure all processesare terminated then try again. If it still fails, a git processmay have crashed in this repository earlier: remove the file manually to continue.
Usually, issues like this happen when multiple Git commands are executed at once. In my case I think there was a stale command from a previous session running in the background.
The fix:
rm -f .git/index.lockAfterwards, I was able to create my new feature branch.

