changing main branch in bitbucket web interface?

kreativkod April 24, 2017

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
Nate Hansberry
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 11, 2017

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
TAGS
AUG Leaders

Atlassian Community Events