TFS reverse integration back to main

10,742

The easiest way I've found to do this is to do a merge using Visual Studio and the Source Control Explorer.

In the Source Control Explorer, right-click on your development branch and select Branching and Merging > Merge

In the Target Branch drop-down select your trunk ("Main") as the destination. This is likely the default selection if you've branched from Main originally.

There are two options:

  1. All changes up to a specific versions: You choose based on a revision and merge it all up to that revision in one fell swoop. If you have a lot of changes, this can save you some time, but also is riskier in terms of resolving conflicts if there have been a lot of changes in Main.
  2. Selected changesets: You select single or groups of changesets to merge back and then repeat this process until you've merged back what you need. Less risky option, but much more time consuming. I personally prefer this approach so that I can see the changes going back into the trunk and know what to expect as changes.

TFS will instruct you if there are merge conflicts while you are merging. This occurs when you change something in the trunk after you've branched to your development. If one of the changes you've made in development conflict with the changes you've made in the trunk, you will have the chance to resolve this in Visual Studio.

If you do not have any conflicts, your development changes will move into the Trunk and simply merge with the changes you already have there.

Share:
10,742
MaSEL
Author by

MaSEL

Updated on June 04, 2022

Comments

  • MaSEL
    MaSEL almost 2 years

    I have the Development branch forked from the Main branch.

    Could I merge the Development branch back to the Main so that Main branch code would be equal the Development branch?

    What is the most safe and reliable solution for this?