TFS2010: Branching Guide

After a lunch-time discussion about branching strategies with TFS I started looking for a good branching guide.  The ALM Rangers put together a thorough guide based on lessons learned from real-world deployments.  The guide provides general guidance for selecting one of four increasingly complex strategies:

  • Basic: Main, development, and release branches
  • Standard: Basic + service pack branches
  • Advanced: Standard + hot fix branches
  • Mature: Single main branch with multiple development, service pack, hot fix, and release branches

Equally important is the discussion about when to create additional development branches:

  • Breaking changes: A change in a common library will break other parts of the system until they are updated to reflect the change
  • Segregated feature work: A team wants to control when its features are released to other teams
  • Next version development: Allows development on the next version to start before the release branch is created
  • Scratch” or Temporary Branches: Prototype work, etc…

If you’re looking for a decent branching strategy guide I recommend starting here.  The document is a pretty quick read and well worth the time spent reviewing it but make sure you take some time to review the supplemental materials as well.  They have a lot of good information that can help clarify or extend the information in the main guide.

ALM Rangers:

TFS2010: Reverting a Branch to a Folder

My team is in the process of transitioning from SVN to TFS for version control. One lesson we just learned the hard way was that TFS doesn’t support the concept of nested branching. Early on in our transition I branched an individual folder and things had been going quite smooth until yesterday when we needed to branch the main folder to spin off a side-project and TFS gave me a nice message about the folder already containing a branch. Uh oh…

I spent a few hours grasping at straws trying to get out of this situation. I even tried reverting a couple of changesets with the rollback functionality included in the TFS 2010 Power Tools but nothing seemed to get rid of the old branch. Eventually I stumbled across this MSDN forum post that said the command to change a branch back to a folder is just a matter clicking File -> Source Control -> Branching and Merging -> Convert to Folder in Visual Studio. After selecting that menu item the branch icon changed back to the standard folder icon and I was able to create the new branch.  Had this option been available in the context menu I’d have found it right away rather than spinning my wheels but now I know it’s there should I need it again.