Team Foundation Server Branching Operation

TFS allows for code branching and merging operations. You may need both of these operations while working on the same project but two different versions of it. For instance, you just finished and deployed website and users start using it on a regular basis. In addition, you started to work on one more feature trying to release that feature next month. However, your website stopped working and you need to troubleshoot it as soon as possible. You cannot really update website which incorporates new feature since it’s not fully functioning yet. As a result, you get stack with the project.

TFS comes to a rescue with the help of Branching and Merging. This is not a new concept, but probably the most successful in its implementation. TFS can perform branching via Source Control Explorer or using command line utility called Branch Command.
tf branch file.cs myBranch

This command will create new branch with the latest version of the file.cs that you may want to update. There are several options that can be used with tf branch command.

  1. /version – specifies the version for which we want to create a branch. It can be changeset, number, label, workspace.
  2. /lock – lock source file and prevents other from checking in/out while you are working with the file.
  3. /noget – prevents users from creating local copies of the files in the new branch.
  4. /noprompt – prevents prompts from appearing every time you try to add item to the branch.

Branching and Merging requires certain permissions set on the server before you can start working and you need to set those rights for a developer trying to merge or branch TFS project. For instance, developer needs “Check Out” on source code permission to perform these two operations at the minimum.

Featured pages

SharePoint Integration

Windows SharePoint Services is an integral part of Team Foundation Server. As a result, there is v…

Creating Team Project

Team Foundation Server allows creation of the portal project via TFS Portal Creation Wizard. This …

SQL Server Agent Jobs

Team Foundation Server installs several SQL Server Agent Jobs that allow it to perform certain tas…

tf Command

tf Command line utility provide many useful operations that we can perform with Team Foundation Se…

Shelving and Unshelving

Shelving is very powerful feature of the Source Control in VSTS that allows storing pending change…

MS Project Fields Mapping

TFS works with MS Project via mapping file with specific fields mapped from one application to ano…

Using MS Project with Team Foundation Server

MS Projects allows accessing Team Foundation Server and working with the TFS Work Items. This is a…

Managing Documents in TFS

Team Foundation Server provides us with the capability to manage various documents, also called ar…