Don\'t ask me how but I managed to get accidentally the following remote branches in a git repository:
$ git branch -r origin/HEAD -> origin/master or
It's
git branch -r -d origin/ref/heads/master
instead of
git branch -r -d origin/refs/heads/master
in the code part to delete branch. There is difference in ref word in the code.