tfstfs-2012

Branching for a Patch in Team Foundation Server 2012


I'll preface this question with the statement that we are likely using TFS incorrectly based on some early misunderstandings on how TFS works, versus how GIT works.

Background:

There seems to be a flaw in our basic understanding of how to accomplish this task, and though it does not happen often, it always bites us, so what are we missing, and what is the correct way to do what I have outlined above?


Solution

  • Well there are many strategies of branching and only you can decide which is most suitable for you. What I see from the question is that you have main development branch and release branches. You have no branch for testing. You have no branches for parallel development. You have branches for hotfixes. One way to organize branches is:

    O----------------main dev branch------------------>
        |                                             ^
        V                                             |
        O---------------release branch---------------->
             |                                        ^
             V                                        |
             O--------------hotfix branch------------->
    

    So you have 1 branch for main work in development. Branch for realese from main(one branch not per release). And branch for hotfix from release. For versioning you can apply labling on release branch(https://msdn.microsoft.com/en-us/library/ms181439.aspx). Now you can merge without problems from main to release, from release to hotfix and back from hotfix to realese and from release to main.

    In reality things get a little complicated with testing branch and parallel development branches. In my project we use something like this:

    O--------parallel dev2---------------------------->
    ^                                                 |
    |                                                 V
    |    O---parallel dev1---------------------------->
    |    ^                                            |
    |    |                                            V
    O------------------main dev branch---------------->
         |                                            ^
         V                                            |
         O--------------test branch------------------->
             |                                        ^
             V                                        |
             O--------------relese branch------------->
    

    But without all this, your design should also work. The main reason you have problems is that you are doing a baseless merge when you could merge hotfix branch back to release branch and from release back to main branch.