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: , ,

Comments

1.
Chris Deweese Chris Deweese United States says:

Looks like you are really digging into TFS.  Good to see!  How is the team doing with this strategy?

Combined with good testing it seems like this is a nice blend between the standard and advanced. I guess the big question is, how hard is it to keep this stuff straight in your head while you're cranking out new features and hot fixes?

2.
trackback Cadred (dotNET) says:

.NET Pulse 2/2/2010

.NET Pulse 2/2/2010

3.
David David United States says:

Chris,

My particular team is doing well with this strategy.  We have encountered a couple of issues in the last few months that needed hot fixes and I was able to easily branch another hot fix and then merge back down to Baseline production and then Main. One of the things that has come up is that you really need to have one person who keeps tabs on the branching and merging and double checks to make sure that things get merged back to Main from Production.  I am really looking forward to the graphical representation of the branches that will be in VS2010 RTM.  That one feature alone should help to improve tracking the various branches on a product.

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading