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?

link|improve this question

support.github.com/discussions/repos/… could help, perhaps? – VonC Jun 8 '11 at 8:44
I've tried that, it doesn't help. – Raphink Jun 8 '11 at 8:58
feedback

1 Answer

up vote 12 down vote accepted

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.

link|improve this answer
Awesome! was looking how to do that on GitHub for 20 minutes before I searched here. – rlemon Jan 20 at 20:55
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.