TFS 2010 Branch Across Team Projects - Best Practices

tfs branching and merging best practices
tfs branching and merging step by step
tfs branching strategy for agile
tfs branch workflow
tfs best practices
release isolation branching strategy
tfs versioning best practices
visual studio 2019 branching and merging guide

I'm having issues understanding how to configure TFS according to best practices as provided by the TFS Ranger team. The issue is such:

My company has several products which make use of a shared common code base.

> $/Core
>  -> /Main/Source (Parent Branch)
> $/Product1
>  -> /Main/Source
>  -> /Main/Source/Core/Source (Child Branch from $/Core)
>  -> /Main/Source/...
> $/Product2
>  -> /Main/Source
>  -> /Main/Source/Core/Source (Child Branch from $/Core)
>  -> /Main/Source/...

Therefore we have one team collection and say, three team projects for this example. ($/* is a team project)

Our initial release branching is a bit of a pain. Instead of branching on the /Main to /Releases, or /Main to /Development, we have been branching each project individually. (Not team project ... solution project.)

This is due to the inability to have nested branch roots. (See TFS Errors: TF203028 and TF203071)

According to TFS Ranger Guide and our revised approach to branching releases, hotfixes, developments, we should branch from /Main rather than /Main/Source/Proj1,/Proj2,/Proj3, etc. It's just become a rather large annoyance.

Ideally we would like:

> $/Product1
> -> /Main/ (Branch - Parent)
> -> /Releases
>    -> /1.x
>       /1 Service Pack (Child Branch from $/Product1/Main
>       -> /1.0
>          -> /1.0 Hotfix (Child Branch from $/Product1/Releases/1.x/1 Service Pack)
>          -> /1.0 RTM (Child Branch from $/Product1/Releases/1.x/1.0/1.0 Hotfix - Read Only)
>          -> /1.0.22 RTM (Child Branch from $/Product1/Releases/1.x/1.0/1.0 Hotfix - Read Only)
>       -> /1.5
>          -> /1.5 Hotfix (Child Branch from $/Product1/Releases/1.x/1 Service Pack)
>          -> /1.5 RTM (Child Branch from $/Product1/Releases/1.x/1.5/1.5 Hotfix - Read Only)

Solutions: 1. We can convert each shared branch (ie. $/Core) back to regular folders. This way no folder under /Main is a branch root. We can then perform a baseless merge from $/Product1/Main/Source/Core/Source back to the parent $/Core/Source.

Has anyone any experience with baseless merges. What I've read from Microsoft is that they are exceptions which should not be commonplace. MS states that if you set up your projects properly with TFS, you would never need to perform a baseless merge.

How is this possible when branching across team projects?!? It should be commonplace in any software development house to have shared libraries amongst products.

I'm open to other solutions too.


I'll throw an option in to the ring, it may or may not not be useful to you. If it's any consolation I've been pondering over this one for a while now and haven't been able to come up with a completely satisfactory solution. It's a really good question and I'd be very interested in seeing how others have solved this problem.

I know it's considered a good idea to build from source wherever possible but I'm not a fan of branching between Team Projects. If you have a some common code and it needs to be branched between 2 or 3 other Team Projects then the branching is manageable but if you have 20 or 30 (or 100) Team Projects then managing the merges becomes a headache. There can be other issues if the developers working in the consuming Team Projects don't have the same permissions in the "master" such as not being able to see history etc. Of course if you have code that needs to be shared between Team Projects in different Project Collections then you can't branch anyway.

So with that in mind I would suggest that you treat the common code in the same way you might treat a 3rd party library and use binary references. Once you get in to that mindset a number of options are available to you. (here are a few but there are probably more)

  1. You could have the build for your common code copy the binaries to a drop location, alongside a merge module for packaging (if you use MSI). You then create a binary reference to the drop location and get whatever you use for packaging to import the merge module. In this scenario you need to make sure that the drop location is stable (and preferably read only to most of the devs to prevent tampering)
  2. Similar to option 1 but use a tool like NuGet to manage your references, this will automate the process of referencing new versions of the binaries.
  3. You could just check in the binaries to $/Product1/branch/lib/common folder in your branch and reference them using a relative path

As I said, I'm very interested in hearing how other SOers have solved the shared code problem using TFS.

EDIT: After 8 years of thinking about this, Nuget packages are the way forward here. I've left the rest of the answer in place as it still gets views and up-votes. Building dependencies in to packages and storing them in a binary repository (nuget / Nexus / Artifactory / Azure Artifacts etc.) is pretty much the standard way of solving this problem

TFS 2010 Branch Across Team Projects, I am having difficulty understanding how to setup Main, Development, & Release branches when branching across team projects. This scenario� I'm having issues understanding how to configure TFS according to best practices as provided by the TFS Ranger team. The issue is such: My company has several products which make use of a shared c

TFS 2010 Branching Revisited:

I would like to offer a mode of confidence for the TFS 2010 baseless merge feature as a way to resolve this issue. I highly recommend picking up the Wrox book "Professional Team Foundation Server 2010".

In it, it describes this problem in depth and whilst it doesn't advocate the use of baseless merges, it sheds light on how to use them in scenarios like this.

We have been using them since this question was first resolved back in April and have yet to encounter a situation where the baseless merge present a problem. I wanted to post an image detailing our branching setup as recommended by the book and the ALM Ranger Team.

TFS 2010 Version Control: Branching and Branch Hierarchy , The way branching process behaves in TFS 2010 is different than the NET Projects - Best Practices you can see that it has got converted to a branch along with its child branch. We can select any branch in the team project and compare it with any Coding Practices: The most important ones – Part 1 Navigate to team explorer, connect to your team foundation server if you're not already and open the team project you're working on. TFS will busy itself loading the work items, etc. but all we're interested in is the last item on the list, source control explorer. Once source control explorer is loaded you should see a list of all the team

For achieving what you want, you need to first convert all branches under root to folder and then you will be able to convert the root to folder.

We had were stuck with merging under different branch and then we went for baseless merge. It took sometime to figure out how it works but then we were successful in doing merge accross branch and then creating the relationship between them.

tf merge /baseless "D:\TFS2010\Root\ServicePack" "D:\TFS2010\Root\MainLine" /recursive

Once you have done baseless merge, you need to check-in all the files. Still you will find the relationship between the branches is not created.

For this click on ServicePack branch(as per my example) and then from file menu click Source Control -> Branching and Merging -> Reparent. There you will have the option of re-parenting. Once done, hence forth whenever you want to merge across these branches you will be able to do like a normal merge across branches.

[PDF] branching guidance, rather focus on best practices and real world examples of patterns that work This branch is the junction branch between the development and release branches. /enable-branch-visualization-in-upgraded-team-projects-tfs-2010- beta1.aspx. Using areas in existing team project instead of creating a new team project (a.k.a. “prefer small number of big team projects over large number of small team projects”) has been established best practice for long time. Microsoft works that way internally and they recommend everyone should.

I've been configuring TFS just now and met with the same problem. The point is, there's no need in baseless merge. Workaround:

  1. Create parent branch


  2. Create child branch

    $/Product1 -> /Main -> /Main/Core -> /Main/...

  3. Delete child branch folder


  4. Create folder with the SAME name


  5. Convert Product1 folder to branch


Now you can merge changes from $/Core/Main to $/Product1/Main/Core and backwards. Visualization won't work for Core branch, but it's okay I guess ;)

How to utilize branching and merging with Team Foundation Server, To find out how to link a database to a Team Foundation Server repository, as well as what By creating a branch, the user creates a folder (project) inside the repository that but recommended for a better overview and easier navigation through branches. A changeset on top represents the initial commit of all objects:. Creating a Team Project in TFS. 05/04/2012; 8 minutes to read +3; In this article. by Jason Lee. Download PDF. This topic describes how to create a new team project in Team Foundation Server (TFS) 2010. This topic forms part of a series of tutorials based around the enterprise deployment requirements of a fictional company named Fabrikam, Inc.

If you want to share common code then you can try the following solution:

Go to File->Source Control->Add Project from Source Control...

This will pop up a dialog allowing you to add a project from elsewhere in source control.

Once you get into sharing projects like this, it's worthwhile getting a bit robust in your source control structure.

One thing I notice is that if you make changes to the common code then it will not be automatically checked out. So it's kind of similar to referencing the projects difference is that it works in the TFS as well.

Original answer

Project of Projects with team Foundation Server 2010, I have updated this as One Team Project for Visual Studio 2012. as easily understandable for everyone, while giving the best functionality. Tip: If you have many projects, over 100, you should consider Note: Consult the Branching Guidance for Team Foundation Server 2010 for more on branching. Temporary, unused, and abundant branches cause confusion and overhead for the team. Can a codebase be branched across projects? Yes. It is not recommended, unless teams must share source and cannot share a common process. What about the code promotion strategy? The Code Promotion strategy feels like a relic from the waterfall development era.

Visual Studio TFS Branching and Merging Guidance, Since its inception in 2006, the Visual Studio ALM Rangers team has around branching and merging with Visual Studio TFS 2010 by The Rangers Branching Guidance started as a Rangers project after We want to make it clear that the best practices and guidance presented in the 2010 guidance� In Source Control Explorer, right-click the branch that you want to branch, point to Branching and Merging, and then click Branch. The Branch from dialog box appears. In the Target Branch Name box, specify the path of the new branch. (Optional) In the Branch from version section, click one of the following options in the By list:

TFS2010: Reverting a Branch to a Folder, My team is in the process of transitioning from SVN to TFS for version control. when we needed to branch the main folder to spin off a side-project and TFS gave me Eventually I stumbled across this MSDN forum post that said the TFS2010: Dealing with the Check-out ModelIn "Practices" Good luck! In part because the latest version is titled Rangers Visual Studio TFS Branching Guide 2010, there has been some apparent confusion whether this guidance applies exclusively to Visual Studio 2010. We want to make it clear that the best practices and guidance presented in the 2010 guidance documents can continue to be applied to earlier versions

TFS Interview Questions And Answers [UPDATED] 2020, Here are the Top 70 Essential TFS Interview Questions & Answers that will help you “Team Foundation Server Best Practices Analyzer” which you can run against the server Is there a way to link work items across projects in TFS This is possible in TFS 2010 at least: LINK TFS WORK ITEM TO DIFFERENT PROJECT In TFS 2012 the product team introduced the concept of Teams into TFS. Before this many organisations created multiple Team Projects and now want to merge Team Projects into one, or at least fewer. There are many reasons you might have done this in the past but there is no reason to live with this.