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. https://blogs.atlassian.com/2013/05/git-automatic-merges-with-server-side-hooks-for-the-win/ 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.
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. :)
Badges are a great way to show off community activity, whether you’re a newbie or a Champion.Learn more
@Davin Studer holds many interests, including but not limited to health tech and Star Trek. Read on to discover more about Davin, from his favorite Confluence macros to his favorite lit...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs