4

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?

Lior Goldemberg
  • 866
  • 13
  • 26

3 Answers3

3

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.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
1

I think this is the cleanest way.

  1. Checkout the master/trunk
  2. Make new branch called master_<date>
  3. Checkout branch you want to become master/trunk
  4. 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.

MarkJL
  • 485
  • 1
  • 9
  • 17
1

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.

Jim Redmond
  • 4,139
  • 1
  • 14
  • 18