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 vote

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 Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

710 views 0 4
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot