Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I create a branch on a TFS/Codeplex hosted project?

Perhaps it's just because I'm not familiar with TFS (I've worked mostly with SVN), but I don't understand how to create a branch on a Codeplex hosted project.

I'm using VS2012. In the Source Control Explorer, I select Branching and Merging > Branch... in the context menu, but then I don't know what to enter in the Target field:

enter image description here

If I try $/wpfanimatedgif/branches/1.3, I get the following error:

The target item $/wpfanimatedgif/branches/1.3 cannot be under the source item $/wpfanimatedgif.

If I try $/branches/1.3, I get this error:

TFS10198: Source control must branch into an existing team project. branches is not a team project.

I also tried to create a new team project from Team Explorer, but I don't have the required permissions.

So how can I create a branch? Or is it impossible to do it on a Codeplex project?

BTW, the reason I want to create a branch is because I'm working on an experimental feature and I don't want to publish to the "trunk" (or whatever it's called in TFS). Perhaps TFS has a different way of handling this scenario? I know about shelving changes, but if I understand correctly, the shelved code won't be available on Codeplex, will it?

like image 921
Thomas Levesque Avatar asked Dec 10 '12 00:12

Thomas Levesque


People also ask

How do I create a new branch in TFS?

Right-click on the FAST Search folder and select Branching and Merging -> Branch from the context menu. Once you clicked on Branch it will open a prompt window and set the Target location and leave the defaults.

Can we create branch in TFS?

The development isolation TFS branching strategy involves one or more development branches. These are kept separate from the main. Each development branch is a complete copy of the main branch. Development branches are built and tested, then code is promoted to the main branch.

How do you create a branch in source control?

In Source Control Explorer, right-click the folder or file that you want to branch and select Branching and Merging > Branch. In the Branch dialog box, under Target box, modify the location and name for the new branch, or select Browse to browse to and select a target.


1 Answers

First, it may help to understand what a "Team Project" is - it's a logical entry in source control at the top-level of the source control tree, and is intended, typically, for a group of developers and various permissions and settings are set at this level. Within a Team Project, you can have multiple development projects such as Visual Studio solutions or Java projects. In this case, your team project is $/WpfAnimatedGif.

As for branching and merging, those occur below the Team Project level, typically as peers to your trunk or main branches. Various branching and merging strategies are covered in the TFS Branching and Merging Guide, but a simplified example for a Visual Studio solution called "WpfAnimatedGif" might have a branch strategy that looks like:

$/WpfAnimatedGif/main/WpfAnimatedGif
$/WpfAnimatedGif/branches/1.3/WpfAnimatedGif
$/WpfAnimatedGif/branches/test_features/WpfAnimatedGif

As for "best practices", they would be to create a trunk or main folder underneath the $/WpfAnimatedGif folder and move your VS projects beneath that. However, you could create a new folder for each branch and branch each project independently.

Eg:

$/WpfAnimatedGif/WpfAnimatedGif branched to $/WpfAnimatedGif/branches/1.3/WpfAnimatedGif

and

$/WpfAnimatedGif/WpfAnimatedGif branched to $/WpfAnimatedGif/branches/1.3/WpfAnimatedGif.Demo

However since these branches are independent, you would also have to then merge these two folders independently, instead of atomically from the branches folder.

like image 170
Edward Thomson Avatar answered Oct 17 '22 06:10

Edward Thomson