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

Automatic Merge - Always merges into a development branch?

Sean Winstead Sep 28, 2015


We are migrating to Stash (renamed to Bitbucket Server) and new to Git.

For a repository, I had set up the following branching model:

  • Development Branch: Use default branch
  • Production Branch: <none currently selected>
  • Feature prefix is issue/
  • Release prefix is release/

My intent was that master contains only the code that has been released to production. For example, if we last deployed release 3.3 to production then head of master contains only release 3.3 code.

We work on two releases at the same time (e.g., 3.4 and 3.5) so we have long-lived release branches that really never go away.

When working on a feature, we branch from a release branch. In this example, if we finish a feature in 3.4 then we could use automatic merge to get the change into 3.5.

It appears that automatic merge also wants to merge changes into the Development branch. As configured in our repository, that would be master.

Is that correct?

To make this work out as intended, do I need to let master become a development branch and let automatic merge update it? Then make a separate production branch that we manually merge a release into once the release goes into production?

1 answer

0 votes
Nirmal Shankar Sep 28, 2015


We can deal branching in a few different ways. We can keep master as the latest production release. And  you can have a branch called "Staging" or "develop" whichever way you want to call it. In a simple scenario, a normal build can happen from staging branch and when you are ready to release the code the production, you can do an auto merge to master branch as soon as the production build is released. You can acheive this in diferent way (making a manual trigger in bamboo to  run once you are sure that a particular code is a prod code). If you use bamboo with stash, then this is a good read


If you have multiple levels of branching, then you can also design branching in such a way that after every release of that branch, you automerge that code to the branch level above that.


Some good reads for branching workflows


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 in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder :  #!/bin/bash source "$(dirname "$0")/" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

3,128 views 1 22
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you