Deleting a remote master branch, abandoning due to the current branch

How to remove a remote master branch from GitHub / Bitbucket?

I'm trying to:

# git push bb --delete master remote: bb/acl: user is allowed. accepted payload.[K remote: error: refusing to delete the current branch: refs/heads/master[K To ssh://git@bitbucket.org/user/reponame.git ! [remote rejected] master (deletion of the current branch prohibited) error: failed to push some refs to 'ssh://git@bitbucket.org/user/reponame.git' 

Also i tried

 git push bb :master 

But all this does not work.

+53
git bitbucket github
Dec 26 '12 at 12:44
source share
2 answers

Note. For BitBucket, you will change the default branch by referring to your repo settings, and change the branch in the Main branch combo box.

main branch on BitBucket

Once the main branch ceases to be a master, you can click and delete the master .

+105
Dec 26 '12 at 16:01
source share

In the lock settings on the options tap on the settings page (well, just click on the Settings tab on the repo page of your GitHub), you can change the default branch (you need to have a different default branch on GitHub a),

change default branch on github

After you have done this, you can delete it:

 $ git push bb :master 
+48
Dec 26 2018-12-12T00:
source share



All Articles