New Team Project from Existing, Branched Project - How to Retain Branch Paths?

3k views Asked by At

I have an existing Team Project created with the out of the box MSF for Agile 5.0 process template. We have since standardized on a customized Microsoft Scrum 1.0 template. I have just created a new Team Project, using our current template, based on the existing project. No further work will be done in the original Team Project.

This existing Team Project uses the "Basic" branch pattern from the ALM Ranger's Branching Guidance:

Original Team Project Branch Hierarchy

When creating the new project, I took the option to start the new project by branching from the original. The result is not what I had in mind:

New Team Project Branch Hierarchy

I wanted a "Team Project 2/Development/Development" branch that branches from the "Team Project 2/Main", and the same with "Release". This leaves me two questions:

  1. Is there something I should have done differently to get the structure I want?
  2. Is there something I can do now to change the new (bad) structure to the one that I want?
2

There are 2 answers

2
Nick Nieslanik On BEST ANSWER

To get the structure you wanted, I think you would have needed to do the following:

  • Create the new Team Project with an empty source control area rather than branching.
  • Then in TP1, branch Main to TP2/Main (or "staging" and then into main ) manually
  • Then create the branches for Development/Dev and Release/Release off the new Main

What this doesn't do is migrate your old Dev and release branches. To get any changes from them over to your new structure, you'd have to preface this entire process with merges back into the TP1\Main. Obviously this is a little less than ideal if you want to keep the old "Release" frozen. In that case you'd probably want to Branch that explicitly into the new TP2/Release/Release area and note that it came from the old project. Then you could establish the new branch relationship to TP2/Main on newer releases only.

As for "Is there anything I can do now?" I think the answer is, no, nothing short of something very drastic, like starting this process over again or just shutting down the existing branches and re-branching using the suggestions above.

1
Bruno Matuk On

To achive the structure you want, after create the new Team Project, you have to perform a Baseless Merge. Baseless merge is used to merge branches that don´t have relationship. After you perform a baselees merge, Tfs will establishe a relationship between the branches.

Note: In the "View Hierarchy" window you won´t be able to see the connection link between the branches, but througth the "Source Control Merge Wizard", you will be able to select the branch and merge.

In your case, you can perform a baselees merge between "xxx2/Main" and "xxx2/Developement/Developement" and another one between "xxx2/Main" and "xxx2/Release/Release". After performing the baseless merge, TFS will create the relationship between the branches, and you´ll get your structure.

Edit 1: "Source Control Merge Wizard" == In "Source Control Explorer" > Right Click the desired branch > Banching and Merging > Merge. In the "Target branch" you will be able to select the branch.