Another git process seems to be running in this repository
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.
Try deleting index.lock
file in your .git
directory or in one of your worktrees .git/worktrees/*/index.lock
if you are in a worktree.
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