Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Automatic Merge - Always merges into a development branch?

Sean Winstead September 28, 2015

Hi,

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 September 28, 2015

Sean

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 https://confluence.atlassian.com/bamboo/using-plan-branches-289276872.html

 

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

https://confluence.atlassian.com/stash/workflow-strategies-in-stash-337772794.html#notfound

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events