How to Perform a Merge

- J.D. Meier, Jason Taylor, Alex Mackman, Prashant Bansode

Use the merge command to integrate changes from one branch into another. To perform a merge, you can use the merge functionality in Source Control Explorer, or you can use the tf merge command line. You can merge by changeset, label, date, or version. To start a merge, right-click the branch in Source Control Explorer and then click Merge. The Source Control Merge Wizard allows you to choose the target branch with which to merge.

Depending on your branch structure, you might need to merge changes up the branch hierarchy, down the hierarchy, or across the hierarchy. If you are merging across the hierarchy, you are performing a baseless merge and you must use the tf merge command line, because you cannot do this with Visual Studio. A baseless merge allows you to merge files and folders that do not have a branch/merge relationship. After a baseless merge, a merge relationship exists and future merges are not baseless. You still need to execute the merges from the command line, but the number of merge conflicts will be reduced.

Keep the following in mind when performing merges:
  • Merging along the hierarchy—from parent to child or from child to parent—results in fewer conflicts than merging across the hierarchy.
  • The branch hierarchy is based on the branch parent and branch child, which might be different from the physical structure of what you see in Source Control Explorer; for example:
    • Physical structure:
      • Development –Development branch
      • Main – Integration branch
      • Releases – Container for release branches
        • Release 1 – Release Branch
    • Logical structure:
      • Main
        • Development
        • Release 1

Additional Resources

Last edited Jul 31, 2007 at 1:46 PM by prashantbansode, version 11

Comments

No comments yet.