Can’t remove remote branch in git

git

I'm trying to remove a remote branch with git:

rpinson@rpinson:~/dev/charismanie$ git remote show origin 
* remote origin
  Fetch URL: git@github.com:raphink/Charismanie.git
  Push  URL: git@github.com:raphink/Charismanie.git
  HEAD branch: xetex
  Remote branches:
    master tracked
    xetex  tracked
  Local branch configured for 'git pull':
    master merges with remote master
  Local ref configured for 'git push':
    master pushes to master (up to date)
rpinson@rpinson:~/dev/charismanie$ git push origin :xetex
remote: error: refusing to delete the current branch: refs/heads/xetex
To git@github.com:raphink/Charismanie.git
 ! [remote rejected] xetex (deletion of the current branch prohibited)
error: failed to push some refs to 'git@github.com:raphink/Charismanie.git'

Is there a way I can remove this branch from the list of "Remote branches" so I can remove it?

Best Answer

The branch was set as default on github, preventing it from being deleted.

On github, I went to "Administration" in the project, reset the default branch to "master" and I was able to remove the xetex branch.

Related Question