Manually resolve conflicts in merge commit on the target branch
There are multiple ways to resolve merge conflicts using Git: (1) rebase, (2) resolve the conflicts in the source branch before merging into the target branch, and (3) resolving conflicts in the merge commit that merges the changes from the source branch into the target branch. GitLab only supports resolving the conflicts in the source branch before merging into the target branch.
GitLab should support resolving conflicts in the merge commit that merges the changes from the source branch into the target branch directly in the GitLab interface. This could be called Resolve conflicts in merge commit
Further details
To illustrate the difference between these approaches by way of example, changes have been added to master that cause our new feature branch to have conflicts with master preventing it from being merged.
X feature
/
A---B---C master
There are a couple of ways address this:
-
rebase
featurebranch onmasterlocally, then merge; orY feature / \ A---B---C---o master -
Resolve conflicts (this could also be done locally too) – merge changes from
masterbranch intofeaturebranch to resolve the conflicts, then mergefeaturebranch intomasterbranch; orX---Z feature / / \ A---B---C---o master -
Merge locally – locally merge changes from
featurebranch directly in tomasterand resolve the conflicts in the merge commitX---. feature / \ A---B---C---o master
GitLab's Resolve conflicts feature uses approach number two, which is merging the changes from the target branch back into the source branch, so that a clean merge can occur.
The downside of this is that it creates an additional merge commit.
Proposal
Add support for resolving conflicts using the GitLab interface in the merge commit on the target branch.
Links / references
-
https://help.github.com/articles/resolving-a-merge-conflict-on-github/
GitHub resolves conflicts directly in the merge commit on the target branch