Branching and Merging in Team Foundation Server

Branching allows us to create a replica of existing project by diverging it into its own path. Branching commonly used to create new project from existing project when we require working on two projects at a same time that contain same files at the time of branching. For instance, when we release application to production environment, we need to support it while working on additional functionality of the application. As a result there is a need to have two projects in parallel one for doing fixes to released version and another for incorporating new features.

Branching can be done via TFS Source Control or from command line using “tf branch” command line. Branching has a source and a target. Source is the project we are trying to replicate into target project. In order to fully create the branch, we need to commit all the pending changesets. Another important aspect is that all files must be in a non-deleted state before they can be branched out.

Check-Out permission is required for the branching operation.

Merging allows to combines two different branches into one. Once more source branch and target branch are required and changes are incorporated from source branch into target branch.

Merging can be done via TFS Source Control or from the command line using “tf merge” command. Merge detects files that were added or modified inside Source Branch and will add these changes or file into Target branch. If same files on the Target Branch were modified, then Conflict Resolution screen will pop-up with the opportunity to resolve the conflict.

Important to note, if we try to merge items with the identical names, type conflict will occur. Merging does not handle this kind of situations but error messages are being logged.

TFS Source Control keeps all the historical records for mergers that have occurred and we can review those by utilizing “tf merges” command line.

Check-Out permission is required for the merging operation.

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…