gitbitbucket

How to change the main branch in BitBucket?


I have a repo on bitbucket with two branches. First branch is master with a fake content, then I have another one called trunk with the correct content.

I would like to change the main branch to trunk (actually is master). I found that in the repo adminsitration are on bitbucket web I could change this but I couldn't.

Finally I would like to understand if is possible to do this through terminal from my local repo.

Maybe an easy thing is to delete contents from master and merge trunk into master and the delete trunk but I neither know how to do this.


Solution

    1. Repositories.
    2. Click on a repository.
    3. Repository settings.
    4. Advanced
    5. Main branch.
    6. Change it from master to main or something else.
    7. Save changes.

    Back in the day

    1. Repositories

    enter image description here

    1. Select repository
    2. Settings

    enter image description here

    1. Main branch: master

    enter image description here

    1. Save repository details

    enter image description here