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:
    • Source: Your branch (Incoming changes).
    • Target: The main branch (Current state).
    • Result: The final file.
  4. Navigate line-by-line. You can click a button to “Take Source” or “Take Target.”
  5. Once all red lines are green, click Submit Merge.

Note: This method is perfect for simple logic or text fixes. If the conflict is complex or involves massive refactoring, do not use this. Move to Method 3.

Method 2: The Visual Studio Approach (The GUI Way)

For developers working in the .NET ecosystem (C#, F#, ASP.NET), Visual Studio provides one of the best conflict resolution tools on the market.

Step 1: Fetch the Conflict

You cannot resolve the conflict in Visual Studio if your local machine doesn’t know about it.

  1. Open Team Explorer (or the Git Cha