It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to change MAIN branch in BitBucket?

Have a main branch in BitBucket named "trunk" (after import from SVN).

Also have branch named "master" - branched from "trunk".

How to set "master" the main branch in BitBucket and then delete "trunk" branch?

3 answers

1 accepted

6 votes
Answer accepted
git symbolic-ref HEAD refs/head/master
git branch -d trunk

refs/heads/master

NOT

refs/head/master

??

Is solution working for new branch to be set up as default branch? I need to set new default branch other than master, I need to each time do the same thing as first aswer, need to write and automation script which do the same for 4 repositories.

Ref - https://stackoverflow.com/a/37550604/1589444

In Bitbucket UI:

  1. Select the repository
  2. Select Administration
  3. In Repository Details, set Main branch

Now delete unnecessary branches with git branch -d.

In the updated Bitbucket UI, select *Settings* instead of *Administration* in Step 2.

Like 2 people like this

Check permissions if you don't see the "Settings" link.

Like 1 person likes this

Thanks, worked

Why did I get an email for Carlos' "Thank" reply? I merely replied to Christian's reply on a separate sub-thread.

I notice this thread is marked "Watched" for me... I don't want to auto-watch a thread just because I reply to someone in it.

After changing the main branch - when cicking on "save reporistory details" i get a wired error:

"You can't create repositories under this account."

 

Seems like you need admin access.

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published Mar 14, 2019 in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder

...ipe.sh :  #!/bin/bash source "$(dirname "$0")/common.sh" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

1,000 views 1 16
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