Share via


How to: Branch Files and Folders

Branching is a Team Foundation version control function to create new folders or files that are based on existing ones. Branches can be used for various reasons, such as maintenance releases and changes that may break a build. For more information, see Understanding Branching. Branching can be conducted from either Source Control Explorer as demonstrated in this topic, or from the command line using the Branch Command.

Required Permissions

To perform these procedures, you must have the Check out permission set to Allow. For more information, see Team Foundation Server Permissions.

Procedure

To branch a file or folder

  1. On the View menu, click Other Windows, and then click Source Control Explorer.

  2. In Source Control Explorer, locate the folder or file that you want to branch, right-click it, and then click Branch.

  3. In the Branch dialog box, in the Target text box, modify the location and name for the new branch. You can also click Browse to move to a location.

  4. In the Branch from version section, in the By list, click the version of the file from which you want to create your new branch. You can select one or more of the following options:

    • If you click Latest Version, the branch is created for the latest version in version control.

    • If you click Changeset, you can type the changeset number in the Changeset box. To find a changeset, click the ellipses (). The Find Changesets dialog box appears. In the Find Changesets dialog box, fill in the fields, and then click Find. Select the changeset you want to branch in the Results list and click OK. For more information, see How to: Find a Changeset.

    • If you click Label, you can type the label name in the Label box. To find a label, click the ellipses (). The Find Label dialog box appears. In the Find Label dialog box, fill in the fields, and then click Find. In the Results list, select the label you want to branch, and click OK. For more information, see How to: Find Labels.

    • If you click Date, you can type a date in the Date box or select a date from the calendar on the drop-down menu. The branch is created for the version specified by the date.

    • If you click Workspace Version, the branch is created for the version in your workspace.

  5. Optionally select the Create local working copies for the new branch box to create a copy of the version-controlled item on the local workspace. Clear the check box if you do not need a local copy, and to improve performance by preventing a large selection of items being downloaded to your computer.

  6. Click OK. The new branch is created and presented in Source Control Explorer.

  7. Optionally, if you selected the Create local working copies for the new branch box, and the local folder you selected is not mapped in the current workspace, a Browse For Folder window appears. Browse for a folder, or click Make New Folder, and designate a new folder to sync to the version-controlled items. Click OK.

    Note

    A branch is a pending change. For other team members to see the branch, you must perform a check-in. For more information, see Pending Checkins Window.

See Also

Concepts

Understanding Branching

Understanding Merging

Using Source Control Explorer

Reference

Branch Command

Branches Command