Create a Branch on Team Foundation Server 2013 (TFS)

So, what is TFS. Team Foundation Server (TFS) is a Microsoft product that provides source code management, reporting, requirements management, project management, automated builds, lab management, testing and release management capabilities. It covers the entire application life cycle.

We have a policy where we need to have our software version that is on production available for in case we need to apply a bug fix to that version while development is in progress on the main development line for the next release. We use TFS for version control. To have a separate version of our software, we use TFS Branching. So what is branching. Branching is the duplication of files under revision control so that modifications can happen in parallel with the main development line.

To create a branch on TFS using Visual Studio 2013, Team Explorer and Team Foundation Server 2013, follow the next steps:

Open Visual Studio 2013
Open Team Explorer, visual studio will automatically connect to TFS if it was configured previously.




Click on the Source Control Explorer menu item

















Expand the TFS Project you want to Branch from. I've create a folder under each of my TFS Project called Branches. I use this folder to branch too. Expand the Branches folder









Create a new folder for this release/branch and give it a name




Now to branch. Right click on the folder/branch you want to branch from and select Branch under the Branching and Merging menu item













Complete the Target Branch Name to point to the new folder you've created under the Branches folder and click on Branch



The branching might take a while to complete because it makes a copy of all the files in the target folder. When completed, you will see all the files that you've branched from in the new folder you've created under Branches.

To complete the process, you need to check in your changes by right click on the new folder and click on Check In Pending Changes. In the Source Files channel, type a descriptive comment in the Comment box and click on Check In.

: