Feb 1 2010

An Alternate Branching Strategy

Category: David @ 14:04

Now that I have been working with TFS for a while I’ve done some experimenting with my Branching Strategy after much consultation with the Branching Guides that are available on CodePlex (TFS Branching Guide 2.0, TFS Branching Guide 2010). These guides have a wealth of information that should most definitely be consulted when you are considering your own Branching Strategy.

One of the keys to a successful branching strategy is to branch when necessary and only when necessary; no more, no less.  That being said, there are still a number of valid ways to branch from the most basic to the more complex.  Here are three diagrams from the TFS Branching Guide that show the three most common branching strategies.

Basic

image

Standard

image

Advanced

image

As with all guidance, there are exceptions.  In my case I was looking at the Standard branching strategy and finding myself in a situation where there were times when I needed to perform several Hotfixes over a course of time.  However, with at least one of my products there was no way to determine how many Hotfixes we were going to have before the next major release.  Following the Standard or even Advanced strategy didn’t allow me to dynamically add Hotfix releases as an issue was resolved and ready for RTM.  So, I came up with the idea of branching from MAIN to a Baseline Production branch from which all my other RTM branches would originate.  This allows me to create a new Hotfix branch as needed from a common Production branch.

The diagram for my Branching Strategy ends up looking like this:

Branching Diagram

This strategy falls somewhere between the Standard and Advanced strategies defined in the Guidance but also incorporates the flexibility to branch for Hotfixes when needed.  It also allows for concurrent development on a Service Pack should that be needed while still having the Baseline Production branch that acts as an accumulation point for all changes on Production code.

I am sure I am not the first one to come up with this particular strategy since “there is nothing new under the sun.” So, I would love to hear what you all think about this particular strategy.  What do you like about it? What do you see as some of the issues with it?

Tags: , ,