changing main branch in bitbucket web interface? Edited

I am the only developer on a local project that is pushed daily to Bitbucket.

1) If I set a new main branch in the Bitbucket web interface (in my repo's settings), will that suffice, or do I need to do something locally as well?

2) If I set a new main branch in the Bitbucket interface (to say 'newmaster'), and then go to another computer and clone the repo, will I be getting newmaster downloaded instead of master?

3) Are there any risks involved when changing main branches in the Bitbucket web interface (such as corrupting the commit history or other damaging branches)?

Thanks!

1 answer

0 votes

Hi Peter,

I did a bit of testing on this and here is what I found out:

 

1) If you create a new branch in the Web UI you'll need to track that branch locally (in your working directory) and then ensure you are on that branch when you are making changes locally as well as pushing to that branch remotely. This is true whether you make the new branch the main (default) branch or not.

 2) If you set a new main (default) branch named newmaster and clone the repo from a new computer you will be cloning the newmaster branch.

3) If you create newmaster from master there shouldn't be a need to worry since newmaster is picking up where master left off (commit history-wise). As far as damaging other branches, as I recall a branch, regardless of whether it is the default or not, can only affect another branch if it is merged into that branch. Creating a new branch and making it the default branch shouldn't inherently harm another branch.

 

I hope this informaiton is helpful!

 

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

1,906 views 7 10
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you