It's not the same without you


Atlassian Community Hero Image Collage

Automerging from release build back to trunk

I am looking for a good way to automatically merge on push from a release build like release/3.0 back to my main/default branch (in this case it is called dev). The thinking is that I want any change made in a release branch to also be in the dev branch. I looked at the auto merge function from Stash. That appears to only merge downstream to later release branches, but not upstream to the dev branch.

My next thought was to use the auto merge feature in bamboo, as I am already doing a build on each push. The problem there is that I don't want to build the merge, I want to run the build on release/3.0, and if successful, then merge release/3.0 into dev, and push to dev, but the build results are just from release/3.0.

The only way I can think to do this is to use a post receive hook to automatically merge any push to release/* to dev. explains how to do this. What isn't clear is what happens when the merge has conflicts? Also, if I merge to release/3.0 via a pull request, I'm not sure this would even trigger the post receive hook.

Any ideas?

2 answers

I solved this issue by creating a second build plan on bamboo just for doing the merges. It doesn't produce any artifacts, just tests the merge down to dev to see that it merges and builds.

Hi Chris,

This sounds exactly like the automerge feature you mentioned. If 'dev' is set as the 'default' branch in the repository it should work. Although currently it only kicks off when a pull request is merged, not when you push to the release branch.

Regarding your question about conflicts - our automerge plugin will raise a pull request and email the original 'author' when that happens. When those conflicts are resolved the merge will continue to be automerged up the release chain until it hits the default branch.

(Doing a merge via a Pull Request does fire a Stash-level AsyncPostReceiveHook, but not an _actual_ Git hook as it wasn't done via a push)

We use automerge in Stash heavily and I couldn't imagine going back to doing it any other way. :)



Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Agile

Webinar: Dean Leffingwell and Steve Elliot present on SAFe 5.0, come ask Dean and Steve questions!

...steemed Steve Elliot (head of product for Jira Align). Agenda: What’s new or changed in SAFe 5.0: Introduction of OKRs Essential SAFe How to achieve true business a...

233 views 0 1
Read article

Community Events


Find an event


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

Host an event


Events near you