How to Resolve Merge Conflicts in Azure DevOps

In this guide, I am going to walk you through the three ways to merge conflicts in Azure DevOps: the “Extension” method (the easiest), the “Visual Studio” method (the most visual), and the “Command Line” method (the most reliable).

How to Resolve Merge Conflicts in Azure DevOps

Why Do Merge Conflicts Happen?

Before we fix the problem, let’s understand the root cause. A merge conflict occurs in Azure DevOps when two different branches have competing changes to the same line of a file, or when one branch edits a file that another branch has deleted.

Git is smart, but it is not a mind reader. When it sees two valid but contradictory changes, it effectively throws its hands up.

Common Scenarios

  • Concurrent Editing: Developer A changes line 10 of Login.cs to “Blue”. Developer B changes line 10 to “Red”.
  • File Renaming: Developer A renames style.css to main.css. Developer B edits style.css.
  • The “Cleanup” Conflict: One developer deletes a deprecated function while another developer fixes a bug inside that same function.

Method 1: The Web Interface (The “Pull Request Merge Conflict” Extension)

For years, Azure DevOps users begged for a way to fix simple text conflicts without cloning the repo locally. Microsoft finally answered. They released an official extension that enables this.

Step 1: Install the Extension

Out of the box, Azure DevOps cannot do this. You need to install the “Pull Request Merge Conflict” extension from the Visual Studio Marketplace.

  1. Go to your Organization Settings.
  2. Select Extensions.
  3. Search for “Pull Request Merge Conflict” (created by Microsoft DevLabs).
  4. Click Get it free and install it for your organization. Check out the screenshot below for your reference.
How to Resolve Merge Conflicts in Azure DevOps

Step 2: Navigate to the Pull Request

Once installed, go to the blocked Pull Request (PR). You will notice a new tab has appeared.

  • Overview | Files | Updates | Commits | Conflicts (New!)

Step 3: Resolve the Conflict

  1. Click the Conflicts tab.
  2. You will see a list of conflicting files. Click on a file name.
  3. The screen will split into three panes: