bitbucket promote a feature branch to be the master

I'm using bitbucket(i love it), and i have this situation: there is a branch called "master", and i want to turn a feature branch (400 commits ahead the master) into the master, withouht dealing with the merge.
to simplify, i thought of renaming the feature branch to "release", and delete the master.

my question is if it's possible to delete the master branch, but still watch its source in the future. (like in the recycle bin..)

if not, is there a way of renaming the master to "master-2015-09" or so?


it's possible to delete the master branch, but still watch its source in the future. (like in the recycle bin..)

No: you just rename master, and keep that newly named branch around for archive.

All you need to do is to rename your other branch to " master " (once master has been renamed first).
That way, the "main" branch as registered by bitbucket remains the same.

if Bitbucket doesn't provide an easy way to rename branches on its web interface, you can rename locally first, and push the new name.


There's currently no way to rename branches inside the Bitbucket GUI; you'll need to rename locally and then push. However, you can change the main branch on the repo settings screen under "Repository details", so that "release" (or whatever you decide to call it) is the first branch people encounter when they clone the repo or visit the repo page.


I think this is the cleanest way.

  • Checkout the master / trunk
  • Make new branch called master_<date>
  • Checkout branch you want to become master / trunk
  • Merge branch with master / trunk
  • Merging shouldn't be seen as something you have to 'deal with'. It's ordinary git functionality. :)

    As Jim says below: You have to do all this locally, I forgot as I never version control web GUIs.

    链接地址: http://www.djcxy.com/p/90398.html

    上一篇: 将分支变成新的主Github

    下一篇: bitbucket推动一个功能分支成为主人