How to convert a branch back to a regular folder


In an effort to remove a small amount of complexity from the UI, we have the command to convert a branch back to a folder appear only under the main menu and not in the right click menu.  The way to convert a branch back to a regular folder is to do the following.

  1. Bring up Source Control Explorer
  2. Select the branch to convert back to the folder
  3. On the main menu bar, click File -> Source Control -> Branching and Merging – > Convert to Folder

Why would you want to do this?  The reason would be just to remove the branch from branch visualizations if you’ve decided you never want to see it again.  This does not change the branching relationship, so you can still merge to and from the branch as before (it just affects the visualization and the properties you see in Source Control Explorer).

You can also do this if you need to remove a deleted branch from showing up in branch visualization.  If you find that a deleted branch is still showing up, you can turn on the option to see deleted items in Source Control Explorer and follow the instructions above.

The full MSDN doc page on this is at http://msdn.microsoft.com/en-us/library/ms181425.aspx.

Comments (11)

  1. Ewald Hofman says:

    Buck,

    You also need this when the migration from TFS 2008 added some invalid branch paths.

  2. buckh says:

    Ewald, that's a great point.  The conversion in the upgrade code is a heuristic, and it will make mistakes, which you can fix using this and the opposite operation (converting a folder to a branch that got missed by the upgrade code).  Thanks for pointing that out!

    Buck

  3. wheys says:

    One more reason. You may find that you want to nest a branch under an existing branch. Or to nest this branch under another branch. TFS 2010 does not allow nested branches. But it does allow nested branched folders. If you convert the branch to a branched folder, you can nest a branch under it.

  4. wheys says:

    One more reason. You may find that you want to nest a branch under an existing branch. Or to nest this branch under another branch. TFS 2010 does not allow nested branches. But it does allow nested branched folders. If you convert the branch to a branched folder, you can nest a branch under it.

  5. Robin says:

    Bill, I used the "branch for reuse" under TFS2008 as well. It results in the nested branches you mention, which are not allowed under TFS2010, unless you convert them to "folders". Those obstacles introduced with 2010 motivated me to read the 2010 online documentation in detail and there you can Microsoft states, that the 2008 innovation of "branches for reuse" taken from the "TFS 2008 best practices" white paper by the Microsoft Architecture Team have become deprecated and not recommended with TFS 2010. Again: Microsoft recommends not to use "branched folder" but branches instead.

  6. Ramesh says:

    Good job! Helped me..

  7. David says:

    I am consolidating a lot of branches into a single branch by branching them into sub folders so I can maintain the branch relationship between the old and new version. I am not sure what is the best way to do this if I want to maintain the branch relationship just between the old branch and the new sub folder and nothing having to branch each sub folder from the old branch into the corresponding sub / sub folders under the new branch.

  8. Buck Hodges says:

    David, if you are trying to have branch folders under branch folders, that's not allowed if my memory is correct. If you are planning to just keep the consolidated branch as the branch going forward, you could convert the sub branches back to folders and convert the new top level branch to a branch.

  9. Gerald britton says:

    Tried to follow the instructions, however I do not see “Branching and Merging” under File -> Source Control. I see “Branch” and “Merge” but neither one has the Convert to Folder option:

    BTW VS 2008 with TFS 2012

  10. Buck Hodges says:

    Gerald, VS 2010 was the first version that supported this feature.

  11. Chaman says:

    As an open source guy in 2016, everything Microsoft does leaves a WTF taste in the mouth.
    We should not have to google for something as simple as this.
    #saynotobloat