How to resolve merge conflicts on cascading merges between protected branches?

In our workflow, we protect our release branches to only accept commits via pull requests. This is creating a problem is we have a merge conflict with an automatic cascading merge. The merge conflict pull request gets created, but we're not sure what the proper workflow is to resolve these merge conflicts. 

So far, we've been cutting a new feature branch from master, merging the original feature branch into the new feature branch, merging the target branch for the cascading merge that's failing into the feature branch, resolving the conflicts, and submitting a new pull request to the target branch that the cascading merge is failing on. 

This works, but seems awfully convoluted. Is there a better way? Also, the instructions on resolving merge conflicts in Bitbucket are completely wrong if a target branch is a protected branch (you cannot commit to it directly), causing a ton of confusion. 

1 answer

Let's say I have a restricted release and master branches, requiring two PR approvals before a branch can be merged into these targets. I have made a change in a feature branch, approved the PR and merged the feature into release branch "release/1.3". The subsequent cascading merge to "release/1.4" fails due to a conflict. We solved this with the following strategy:

  1. Create an unrestricted branch from the tip of the target branch
    1. create a new branch "mergefix" from "release/1.4"
  2. Merge the source branch into the unrestricted branch and resolve the conflict
    1. merge "release/1.3" into "mergefix"
  3. Create a new PR from the unrestricted branch to the target branch
    1. create a new PR from "mergefix" to "release/1.4"


Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

22,544 views 26 12
Join discussion

Atlassian User Groups

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!

Find my local user group

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

Groups near you