Developer Drain Brain

November 23, 2009

Branching in TFS

Filed under: Development — Tags: , , , , — rcomian @ 1:51 pm

Some of you may know that I’m a strong advocate for using some of the more flexible branching strategies available to us developers, given the advances in source control over the last 20 years. TFS 2010 is adding in some extra branching support that should make this more compelling.

In short, TFS 2010 knows about branches explicitly. That is, you tell it “this folder is a branch” and it can track things around in a nice visual form. You start out with marking your trunk/mainline branch, then branching from that. Visual studio tracks what gets branched where and can show you the relationships between branches in a nice, simple diagram.

This shows the logical structure of the branches. Here we can see that 3 branches came from Dev and an additional branch was made from “Brian”. The logical structure shows where branches came from and, conversely where changes need to be merged back to. The actual meaning is branch dependent of course – release branches would have changes merged into them from trunk, development branches would have their changes merged into trunk.

The physical structure is where the branches are located in Team Explorer and will be completely different to the logical structure.  The recommendation is that folders are made to hold branches of a common type, so that the physical structure tells you the reason for the branches existence, such as private branches, feature work, stable release branches etc. Each branch can have a description, which is useful for finding out detail about an individual branch, but grouping them in folders makes sense.

This screenshot shows the branch structure in physical form. Notice that branches look different to folders. Also notice that here the Dev and QA branches are siblings in the physical structure, where as in the logical diagram QA is a child of Dev.

Branches can be made quite easily by dragging and dropping from the logical diagram or right clicking a branch on the physical diagram and choosing “Create new branch”. The whole branch process has been streamlined as well. Apparently old TFS checked out all the files onto your machine and waited for you to check them in as a pending change. HUGE waste of time, effort and bandwidth. Now it just makes the branch on the server and you can check it out when you see fit.

Some of you may know that I’m a strong advocate for using some of the more flexible branching strategies available. TFS 2010 is adding in some extra branching support that should make this more compelling.

TFS 2010 knows about branches explicitly. That is, you tell it “this folder is a branch” and it can track things around in a nice visual form. You start out with marking your trunk/mainline branch, then branching from that. Visual studio tracks what gets branched where and can show you the relationships between branches in a visual form.

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: