The issue I'm having is related to an automation project I am working on. Basically, through a UI, someone is committing a change to the end of a file (in this case, test.conf), and at the same time, someone else is commiting a different change to the end of that same file. The order of these stanzas/commits does not matter. I want to keep both changes, as right now Azure Devops repos detects a merge conflict, stopping the approvers from completing in the UI.
For example: Off of a separate branch, in this case "branch_a", someone makes the commit in test.conf of "Hello\nworld\n"
At the same time, someone makes a new branch, "branch_b", and adds "it's\nme" at the end of the file.
Then, 5 minutes later, a PR is made for branch_a to main, and is completed. So at this point, line 1 is "hello\nworld".
Then 15 minutes later, a PR is made for branch_b to main, and has merge conflicts, as main now has hello at line 1, instead of empty.
The issue is, I want both entries to be joined, with no need to pull and merge and resolve conflicts. So the desirable end output would be "hello\nworld\nits\nme". I tried setting merge to union in the git attributes, but that still causes a conflict.
I also want this to be done automatically through azure devops code repos.
I am afraid that there is no out-of-box method can automatically combine two entries in Azure DevOps.
And when you use Azure DevOps Pull Request feature, it will ignore the settings in the gitattributes
and .git/config
. So the union merge setting will not work in Azure DevOps.
To meet your requirement, I suggest that you can install and use the extension: Pull Request Merge Conflict Extension in Azure DevOps.
After you installing the extension, we can solve the conflicts directly in Azure DevOps Pull Request UI.
For example:
In this case, users can combine two entries manually in Pull Request UI and submit the Merge to solve the conflict. Then the approvers can continue the Pull Request Merge.
If you need to use the settings in gitattributes file, you need to pull and merge and resolve conflicts on your local machine.
I can fully understand your requirements. You can submit a suggest ticket in the site: Developer Community to report this feature.