Share via


Understanding Branching

Branching is a feature that allows a collection of files to evolve in two or more divergent paths. Branching is frequently used when teams have to maintain two or more similar code bases, as can occur when a product is released and work must begin on the next version.

Branching in Team Foundation source control is analogous to a file system copy operation. Branching will preserve the history of the folders and files that you are branching and will allow changes to be merged from the old files to the new ones. Branching can be conducted through Source Control Explorer, or from the command line using the Branch Command.

A branch operation has a source and a target. The source provides the name and version of the file or folder being branched and the target provides the location of the destination file or folder. If the specified target is the name of a folder that exists in the server, the actual target will be created within that folder; otherwise, the actual target is as specified.

Branching creates a pending change operation in Team Foundation source control. The branch is not actually created until the pending change in changesets is committed to the server. For more information, see Pending Checkins Window.

Before checking in the branch to the server, files and folders can be modified, renamed, deleted, and undone. For more information, see How to: Move, Rename, and Delete Source-Controlled Files and Folders.

A folder or file must be in a non-deleted state to be branched. Branching a tree of files will not cause the deleted items within that tree also being branched. At a future point, if the deleted item is undeleted in the source tree, a merge operation can branch that file into the target branch.

Tip

You can see a source control items branch history by viewing its properties. For more information, see How to: View Source Control File and Folder Properties.

See Also

Reference

Branch Command
Branches Command

Concepts

Using Source Control Explorer

Other Resources

Branching and Merging Team Foundation Source Control