[go: up one dir, main page]

Skip to content

Add Keep Both option for resolving merge conflcits

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Problem to Solve

When resolving conflicts in a merge request, sometimes you may need to keep both our changes and their changes depending on the information that's being changed. The only way to perform that action in GitLab is to edit the file and remove all of the conflict markers to submit a change that containing both sets of changes.

Proposal

Add an additional option for the conflict resolution that allows you to keep both changes which would automatically remove the conflict markers and combine the changes.

  1. Add a button to the interactive mode "Use both"
  2. Update the description from "To resolve the conflicts, either use interactive mode to select Use ours or Use theirs ..."
    • New copy: "To resolve the conflicts, either use interactive mode to select Use ours|Use theirs|Use both ..."
  3. When selected both changes will be in their selected (darker green and darker blue)
  4. When changes are committed it will include ours then theirs changes

This means when there is a conflict like this on a single line

<<<<<<< ours
foo
=======
bar
>>>>>>> theirs

It will be merged as

foo
bar
View Idle Use ours Use theirs Use both
Side by side image image image image
Inline image image image image
Additional details

VS Code supports a Accept Both Changes option:

image

Edited by 🤖 GitLab Bot 🤖