Richard Moore
Richard Moore

Reputation: 1162

How to branch my Visual Studio Online (TFS) Solution?

I have a fairly complex solution in Visual Studio 2015. It's source controlled using Visual Studio Online with TFS as the source control mechanism.

The structure is as follows:

DefaultCollection
    Team Project Root
        |
        ----Web Apps Folder
              |
              ----Web Application 1
                    |
                    ----WebApplication1.csproj
              |
              ----Web Service 1
              |
              ----Web Service 2
        |
        ----Winforms Folder
              |
              ----Winforms App 1
              |
              ----Winforms App 2
        |
        ----Common Files Folder
        MySolution.sln

MySolution.sln is in the Team Project Root, and the solution contains all the various applications within it which are a mixture of web apps, web services and Windows applications.

The problem I have is that I am new to branching and I want to branch the entire solution, but I think that the way my SLN file is in the root will make this difficult?

What I need is to have Web Application 1 branched, and I understand I can branch Web Application 1. But in order to run it I would need to create a new solution file to contain it which would mess things up.

Is there a way I can Branch the entire solution from this scenario, or will I have to try to re-structure things somehow?

Upvotes: 3

Views: 7757

Answers (2)

chief7
chief7

Reputation: 14383

Your structure should be:

  • Team Project Collection Root
    • Team Project A Root
      • Source folder
      • Source folder
    • Team Project B Root
      • Source folder
      • Source folder

You cannot branch at the Team Project Collection or Team Project Root level. You will have to move the source to a new folder first and then you can branch.

Upvotes: -1

DaveShaw
DaveShaw

Reputation: 52798

I would Create a new Folder at Team Project Root called Main (TFS Convention, SVN it's trunk, git it's master).

Then move all the items in the Team Project Root into that Main folder.

So your structure is now:

DefaultCollection
    Team Project Root
        |--Main
          |--Web A pps Folder
            |--stuff     
          |--Winforms Folder
            |--stuff
          |--Common Files Folder
          MySolution.sln

Now you can right click on the Main folder and from the Branching and Merging sub-menu select Convert to Branch.

enter image description here

Now you can right click on Main branch, and from the Branching and Merging sub-menu select Branch...

enter image description here

Upvotes: 8

Related Questions