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
The solution was to delete the branch refs/heads/refs/heads/master
refs/heads/refs/heads/master
git push origin :refs/heads/refs/heads/master