0

Possible Duplicate:
Deleting remote master branch, refused due to being current branch

I code for the kde project, which uses git. There is a central repo, and I have a local clone with some local branches. Now a distro which I also code for wants some default kde stuff changed, and they use github for hosting their modified code.

The problem is as follows:

First, the github repo was completely empty. Then, I pushed my local master branch (by mistake) to that repo. After having realized that, I pushed the branch that had the distro fixes in it to github as well. Now I want to delete this github master since the distro team does not need it, the packagers need a single branch to build from. Doing this

git push github :master

results in an error "cannot delete current branch".

The question is, how can I switch remote branches to set the branch containing the fixes to "current" and delete the unnecessary "master"?

Thank you!

Community
  • 1
  • 1
iksemyonov
  • 4,106
  • 1
  • 22
  • 42

1 Answers1

1

My guess is that github is not a remote. typically git uses origin

So a git push origin :master should do

You can review the list of remotes by running git remote -v

As far as answering this question "The question is, how can I switch remote branches to set the branch containing the fixes to "current" and delete the unnecessary "master"?"

You didn't provide enough details. What is the name of the branch holding the code you need kept ? what are your remotes?

Olivier Refalo
  • 50,287
  • 22
  • 91
  • 122
  • First off my git knowledge is limited, and I come from SVN, so may give a wrong description. There is a central kde git repository with branch master, I have a local checkout of that repository with branches master (corresp. to kde git master) and a local branch "topic". I've pushed both local master and topic to github, and want to delete the "master" branch on github, so that only "topic" remains there. – iksemyonov Sep 24 '12 at 18:35