tfsversion-controlbranching-strategy

Efficient TFS branching strategy advice


Our company (internal projects) used version control (TFS, now 2015) for simply keeping an audit trail of released code - I have brought in the use of branching and merging and its completely changed the way we look at bottlenecks in the development pipeline and has generally been well received, but now I am looking for the next step.

Our code consists of one large piece of software and several other accompanying business applications.

We have four environments we keep up at all times, and our 'pipeline' is like so.

Now I simply took the approach of having a branch for each environment, allowing for easy compares, for people to quickly grab the source and whatnot, and to see the progression of the codebase up the chain.

MAIN -> STAGE -> TEST -> DEV

This is one single, linear line, and we can simply view the history of the MAIN branch to see all the different released builds.

From the dev branch we splinter off into our local branches, and any hotfixes come directly off the UAT branch.

This works for us - but it works in the sense a procedural program could work - it may not be the most effective approach. I'm just very curious as to whether there are better ways to do this, and after reading loads of stuff online I feel like people don't split their branches by environment but I don't really understand how that works better? Even though it is a pain to merge four times to release some code (although most of the time it is a rather slow pipeline, we have weekly releases).

Any help much appreciated.


Solution

  • You are correct when mentioned that the more complex the branching strategy the more overhead to maintain.

    But if the situation demands there are not escaping. If you have not gone through the branching strategy document by ALM rangers for TFS, please take a look. It should help you.

    I think the strategy you are following is not an linear branching but rather the one in the below image. In a more complex enterprise software the branching strategy boils down to this. Most Complex Branching strategy