Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,359,907
Community Members
 
Community Events
168
Community Groups

How to change MAIN branch in BitBucket?

I have 

5 answers

Hi @rakesh-eminence,

In Bitbucket Cloud, please go to [Your Repository] >> Settings >> General >> Repository details >> Update repository details >> Main branch.

At the same time, I would suggest you on having a look at Branching a Repository, focusing on The Branching model which describes the DEVELOPMENT label and PRODUCTION (disabled by default).

Screenshot 2019-01-10 at 9.41.00.pngMore information is also available on Weird square appeard on Branch site.

Hope the above answer to your inquire.

Kind regards,

Rafael

Hello @Rafael Pinto Sperafico 

 

After following the above - I am still seeing in the branches view that master is identified as MAIN.  I can only view develop branch when I change the selection criteria to all branches.

Like Lucas Rencker likes this

It doesn't work for me.

The branch can only be chose from dropdown list.

But it always limit 25 results and not searching exactly the text I type in, just list out any branch name including that text.

So I could not find the correct branch to set it as main branch.

Like # people like this

There is still no way to change the default initial main branch name?

In my experience, I was able to change this setting from the General > Repository Details sidebar menu tab. In the main content area, there is an Advanced section that is closed by default. Open it and there are other settings, including one for "Main branch"

Like dbadia likes this

This is the correct answer

Like Dean Cox likes this
0 votes

let me know answer?

Here are the steps to change the "Main" branch

  1. Go to Repository Details
  2. Click on Advanced to explore more options
  3. Select the main branch from the "Main Branch" dropdown

Now your main branch is changed.

 

Thanks

is there a way to change the default setting from master to main?

I have not seen it built into BitBucket, however what you can do is create a new "main" or "mainline" branch from master, set that as the root and then delete master. 

I want this for my workspace not per repo

Like # people like this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

3,457 views 3 10
Read article

Atlassian Community Events