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

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

Matt Cruger April 22, 2016

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

0 votes
Sam Eberspacher June 21, 2016

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
TAGS
AUG Leaders

Atlassian Community Events