Merging Dev to Test Branch in Azure DevOps via Visual Studio

MB-500 By islever Editorial Last updated

Manage source code and artifacts by using Microsoft Azure DevOps version control

Short answer

Connect a Visual Studio workspace to an Azure DevOps project, Map the Test branch to a local folder, Right-click the Dev branch and select Merge, In the Source Control Merge wizard set the target branch to Test, In the Source Control Merge wizard select Selected changesets.

Question

DRAG DROP
You have an Azure DevOps project that has Dev and Test branches.
The Test branch is used for deploying artifacts in a test environment.
You must merge code from the last Dev branch and check-in the code to Test.
In which order should you perform the actions? To answer, move all actions from the list of actions to the answer area and arrange them in the correct order.
Exhibit: Merging Dev to Test Branch in Azure DevOps via Visual Studio

Key Takeaways

The main trap is confusing which branch to right-click for the merge initiation; you must right-click the source branch (Dev) even though you have mapped the target branch (Test) locally.

Learn the correct sequence for merging code from a Dev branch to a Test branch in Azure DevOps using Visual Studio's Source Control features. Steps include workspace connection, branch mapping, and configuring the merge wizard.

Common mistake: Learners often incorrectly right-click the Test branch to start the merge process, failing to realize that the merge command originates from the branch containing the changes being moved (Dev).

Expert Analysis

This drag-and-drop question tests the procedural knowledge of integrating Azure DevOps source control with Visual Studio for branch management, specifically focusing on the workflow required to merge code from a development branch (Dev) into a test branch (Test). The scenario requires moving changes from Dev to Test for deployment purposes. The correct sequence begins with establishing the local environment: connecting the Visual Studio workspace to the Azure DevOps project and mapping the target branch (Test) to a local folder. This ensures that the local repository is synchronized with the remote state of the branch that will receive the merged changes.

The next critical step involves initiating the merge operation. In Visual Studio’s Source Control interface, you must right-click the source branch (Dev) within the Team Explorer window to access the merging options. Selecting "Merge" from this context menu opens the Source Control Merge wizard. It is a common point of confusion whether to select the source or target branch for this action; however, the standard Git-based workflow in Visual Studio requires selecting the branch containing the changes you wish to bring over. Once the wizard is open, you specify the details of the merge. You first select "Selected changesets" (or specific commits/changes) from the Dev branch that are ready for promotion. Finally, you set the target branch for these changes to be the Test branch. This order ensures that the correct changes are identified and applied to the correct destination branch.

Comments highlight confusion regarding which branch to right-click. One comment correctly notes that while the Test branch is mapped locally, the merge action is initiated against the Dev branch because it holds the source changes. Another comment suggests right-clicking the Test branch, which is incorrect for initiating a merge from Dev. The consensus among experienced users aligns with the logic of pulling from the source branch after preparing the local workspace.

Exam Strategy

When dealing with drag-and-drop questions about software workflows, identify the 'preparation' steps first (connecting and mapping), then the 'action' step (initiating the merge), and finally the 'configuration' steps (specifying source/target in the wizard). Always determine which branch holds the data being moved versus the branch receiving it, as this dictates the direction of the workflow actions.

Frequently Asked Questions

Why do I need to map the Test branch if I'm merging FROM Dev?

Mapping the Test branch ensures your local workspace has the latest version of the target branch. This allows Visual Studio to correctly apply the incoming changes from Dev onto the current state of Test without conflicts.

Can I merge directly from the Azure DevOps web portal instead?

Yes, Azure DevOps supports pull requests and merges via the web portal. However, this question specifically tests the integration between Visual Studio and Azure DevOps source control, requiring the use of Visual Studio's local tools.

Discussion 6 contributions

Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.

From public community threads 6

  1. JorgeNieves 👍 19
    I think the answer is: • Connect VS • Map the test branch • Right-click the test branch and select merge • In the source control Merge wizard set the branch to Test * In the source control Merge wizard select Selected changesets
  2. is12132023 👍 6
    This does not make sense , if code have to be merged from Dev to Test. After Connecting and Mapping, we need to go right click on Dev -> Branching & Merging -> Merge. In the Source Control Merge wizzard first we select Source branch , then Selected changesets, then Test as Target branch, and from here Next. So i don't know why we go right click on Test branch.
  3. is12132023 👍 2
    Is this correct answer ?
  4. globeearth 👍 1
    The correct order of actions is: D. Connect a Visual Studio workspace to an Azure DevOps project. E. Map the Test branch to a local folder on your machine. C. Right-click the Test branch and select Merge. A. In the Source Control Merge wizard, set the target branch to Test. B. In the Source Control Merge wizard, select Selected changesets.
  5. cbef765 👍 1
    D. Connect a Visual Studio workspace to an Azure DevOps project. E. Map the Test branch to a local folder on your machine. C. Right-click on the DEV branch and select Merge. Not test branch... A. In the Source Control Merge wizard, set the target branch to Test. B. In the Source Control Merge wizard, select Selected changesets.
Show 1 more comment
  1. lalz21 👍 1
    Agreed

Reader comments & corrections

No reader corrections yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Practice All MB-500 Questions

Access 115 questions with complete answers and detailed explanations.

View Full MB-500 Practice Test →

← Back to MB-500 Study Guide