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.