I've created pull request I got into this:
"Approve" button does nothing and complete is disabled.
How do I resolve this confligt in pull request?
Microsoft just added browser based merges. This may get you out of a pickle for small conflicts.
And offers improved visualizations of the different scenarios as of Sprint 150.
You have two options to resolve the conflict, reverse-integrate the changes from the target branch (which creates additional merge commits), or rebase on the target branch (which leaves your history nice and clean).
You need to clone the repo locally, perform a merge from the target branch to your branch and push those changes up to the repository. VSTS will detect the changes and update the pull request.
-------o3 PR
/
---------o1-o2 target
Thus merge target (o2)
to PR
:
-------o3-o4 PR
/ /
---------o1----------o2 target
Then complete the PR
-------o3-o4 PR
/ / \
---------o1----------o2--o5 target
Alternatively, you can clone the repo locally, rebase the PR branch on the latest version of the target branch, solve all issues from the rebase and force-push the changes back to the PR branch. VSTS will detect the changes and update the pull request.
-------o3 PR
/
---------o1-o2 target
Thus rebase o3
onto o2
:
-------o3 PR
/
---------o1-o2 target
Then complete the PR
(with Fast-forward merge in the case below):
---------o1-o2-o3 target
To answer @metabuddy's question:
And then what? This only shows how to resolve conflicts locally, I can't push the target nor source branch directly to VSTS because I have branch policies which require pull requests to be made from feature branches.
You can follow the steps above. Just the source branch and target branch will be slightly different.
dev
branch, then right click on Master
and select Merge into Current Branch
option from the context menu.
You could do the above technique by @jessiehouwing or use the new plug-in. MicrosoftDevLabs released the link to the plugin to resolve conflicts. The link to plugin is given below https://marketplace.visualstudio.com/items?itemName=ms-devlabs.conflicts-tab
This answer is in reference of comment by @metabuddy on the answer of @sky91
What if your target branch in 'master' and on 'master' branch you have the policies applied to not accept direct merges?
Note: Consider 'master' is target branch and 'x001' is the source branch in pull request, which has conflicts between 'master' and 'x001' branch.
In that case solution by @sky91 will not work. For this you to follow these steps.
After some failed attempts, I found works solution, Based on @Sailesh answer in Merge development branch with master question:
Start with merge master
into the development
so that if there are any conflicts, you can resolve in the development
branch itself
(on branch development)$ git merge master
After this you can complete
the Pull Request in the opposite direction without problem