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).
Table of Contents
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.csto “Blue”. Developer B changes line 10 to “Red”. - File Renaming: Developer A renames
style.csstomain.css. Developer B editsstyle.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.
- Go to your Organization Settings.
- Select Extensions.
- Search for “Pull Request Merge Conflict” (created by Microsoft DevLabs).
- Click Get it free and install it for your organization. Check out the screenshot below for your reference.

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
- Click the Conflicts tab.
- You will see a list of conflicting files. Click on a file name.
- The screen will split into three panes:
- Source: Your branch (Incoming changes).
- Target: The main branch (Current state).
- Result: The final file.
- Navigate line-by-line. You can click a button to “Take Source” or “Take Target.”
- 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.
- Open Team Explorer (or the Git Changes window in VS 2022).
- Click Sync to fetch the latest commits from the remote repo.
- Attempt to Merge or Rebase the target branch (e.g.,
main) into your feature branch. - Visual Studio will throw a warning: “Merge completed with conflicts.”
Step 2: Open the Merge Editor
In the “Git Changes” window, you will see a list of “Unmerged Changes.”
- Double-click the file with the conflict.
- The Merge Editor window opens. This is a powerful 3-way view.
- On the Top Left is your code. On the Top Right is the incoming code. The Bottom pane is the result.
Step 3: Check the Boxes
Visual Studio makes this easy with checkboxes.
- Check the box on the Left to keep your change.
- Check the box on the Right to overwrite your change with the incoming one.
- Or, type manually in the bottom window to combine them.
Step 4: Accept Merge
Once the file has no red conflict markers, click the “Accept Merge” button at the top of the window. Commit the change and push it back to Azure DevOps.
Method 3: The Command Line
If you are a DevOps engineer or a non-Windows user (Mac/Linux), you likely live in the terminal. This is the most reliable method because you have full control over every byte of code.
The Conflict Resolution Workflow
| Step | Command | Description |
| 1. Checkout | git checkout feature-branch | Ensure you are on your working branch. |
| 2. Pull Target | git pull origin main | Try to pull the main branch into yours. Git will scream about a conflict. |
| 3. Status | git status | See exactly which files are broken (marked as “both modified”). |
| 4. Edit | code . | Open VS Code (or your editor) to fix the file manually. |
| 5. Add | git add filename.ext | Tell Git “I fixed this file.” |
| 6. Commit | git commit | Save the merge. |
| 7. Push | git push origin feature-branch | Update Azure DevOps. |
Best Practices to Avoid Conflicts
The best way to resolve a merge conflict is to not have one in the first place. While unavoidable in large teams, you can reduce them by 90% with these habits.
1. Pull Early, Pull Often
Do not wait until Friday afternoon to pull changes from main.
I recommend running git pull origin main every morning before you start coding. If you resolve tiny conflicts daily, you avoid the “Mega-Conflict” at the end of the sprint.
2. Keep User Stories Small
If a user story takes 3 weeks to complete, you will drift far away from the main codebase. In the US agile market, we aim to deliver stories in 2-3 days. This ensures your branch is short-lived.
3. Communicate on “Hot Files”
Every project has that one file everyone touches (e.g., appsettings.json, DbContext.cs, or routes.ts).
If you are about to do a massive refactor on a “File,” drop a message in Microsoft Teams or Slack: “Hey team, I’m refactoring the file. Please hold off on file changes for an hour.”
FAQs:
Q: Can I just delete the branch and start over?
A: Technically, yes. If the conflict is too messy, you can backup your files, delete the local branch, and re-clone. However, you lose your commit history. Only do this as a last resort.
Q: What is a “Rebase” and should I use it?
A: A git rebase rewrites history to make it look like you started your work after the latest changes came in. It creates a cleaner history but can be dangerous for beginners. If you mess up a rebase, you can lose code. Stick to merge until you are confident.
Q: Azure DevOps says “Merge Conflict” but won’t let me click anything?
A: You likely haven’t installed the extension mentioned in Method 1. Without that extension, the web UI is read-only for conflicts.
Conclusion
Resolving merge conflicts in Azure DevOps is a rite of passage.
Whether you choose the ease of the Web Extension, the visual comfort of Visual Studio, or the raw power of the Command Line, the principle remains the same: communication. A conflict is just a conversation between two developers that Git couldn’t automate.
So, don’t panic. Read the code, talk to your teammate, and make the merge.
You may also like the following articles:
- How to Create a New Repo in Azure DevOps
- How to Deploy Pipeline in Azure DevOps
- How to Create Pipeline in Azure DevOps
- How to Calculate Sprint Velocity in Azure DevOps

I am Rajkishore, and I am a Microsoft Certified IT Consultant. I have over 14 years of experience in Microsoft Azure and AWS, with good experience in Azure Functions, Storage, Virtual Machines, Logic Apps, PowerShell Commands, CLI Commands, Machine Learning, AI, Azure Cognitive Services, DevOps, etc. Not only that, I do have good real-time experience in designing and developing cloud-native data integrations on Azure or AWS, etc. I hope you will learn from these practical Azure tutorials. Read more.
