Getting the base branch right
Asked by Patrik Tesar:

Hello, we want to have a merge strategy our way, but we can't get it straight.

In the beginning, there is a **master** from the master we create a branch **stage** and from stage branch we create **dev**

So far, so good.

Then we start developing in the **dev** and at some moment we want to test on our test environment we want to go to the **stage,** BUT!! When we create a pull request, the **master** is offered as a base branch, NOT **STAGE**!

And what is even crazier when we want to create a pull request from **stage to master** as a base branch where we should create a pull request is offered **dev**!!

Please help us to solve this issue.

Thx

Patrik


Answers:
author: Mikael Sandberg
body: The default branch used when creating a pull request is determined by the default branch you have on your repository. If you go to your Repository settings \> Branching model and from here you can set your default branch and your production branch. By default master will be your default branch, and it sounds like dev is set as your production branch. Have a look at [Branch a repository](https://support.atlassian.com/bitbucket-cloud/docs/branch-a-repository/) for more information.

comments: author: Julius Davies _bit-booster_com_
body: Default branch is not set on "Branching model" on Bitbucket Cloud.

It's set on "Repository settings -\> Repository details -\> Advanced -\> Main branch"

(And for anyone on Bitbucket Server rather than Bitbucket Cloud, it's also on "Repository details" but under "Default branch").


author: Patrik Tesar
body: This is how I have it:

![Bildschirmfoto 2020-10-09 um 00.13.41.png](https://community.atlassian.com/t5/image/serverpage/image-id/113573iE20DD7AF3DEC72D7/image-size/large?v=v2&px=999 "Bildschirmfoto 2020-10-09 um 00.13.41.png")Then here are screenshots from branches:

![Bildschirmfoto 2020-10-09 um 00.13.50.png](https://community.atlassian.com/t5/image/serverpage/image-id/113575i4B56153600877723/image-size/large?v=v2&px=999 "Bildschirmfoto 2020-10-09 um 00.13.50.png")![Bildschirmfoto 2020-10-09 um 00.14.12.png](https://community.atlassian.com/t5/image/serverpage/image-id/113574i91D802196A4E4B14/image-size/large?v=v2&px=999 "Bildschirmfoto 2020-10-09 um 00.14.12.png")

![Bildschirmfoto 2020-10-09 um 00.14.01.png](https://community.atlassian.com/t5/image/serverpage/image-id/113577i073F001D57426CB1/image-size/large?v=v2&px=999 "Bildschirmfoto 2020-10-09 um 00.14.01.png")

Even I try to change it in the bitbucket, it does not allow it to me!!!

Please provide a fix for this. We need to have the merging strategy right!


author: Mikael Sandberg
body: In order to change the branching model you have to have repository admin permissions.


author: Patrik Tesar
body: Hello [@Mikael Sandberg](/t5/user/viewprofilepage/user-id/853579) i'm the admin and owner of the repo. Bitbucket change it, even when I do refresh, it's changed, then when I move to different branch and back, it's again the old one!!! Even git rebase is somehow ignored from bitbucket! Thx for help


author: Patrik Tesar
body: [@Mikael Sandberg](/t5/user/viewprofilepage/user-id/853579) I can make a video if it will help


Tags: bitbucket-cloud

cloud