xxxxxxxxxx
$ git gc --prune=now
$ git remote prune origin
xxxxxxxxxx
# Change directory to your git repository
cd /path/to/your/repository
# Remove the lock file
rm -f .git/index.lock
xxxxxxxxxx
git refs are files in a directory.
You can't have both a file, and a directory with the same name.
Check that the branch name are not mingled (like an `origin` directory in local branch, )