Share via


How to: Merge Files and Folders

Team Foundation source control provides merging functionality through Source Control Explorer, or from the command line using the Merge Command. For more information, see Understanding Merging. The following procedure demonstrates merging with Source Control Explorer.

Required Permissions

To perform these procedures, you must have the Read permission for the item in the source tree and Check out permission for the item in the target tree set to Allow. If the item in the target tree is being renamed, you must have the Check out permission for both the source tree and the target tree set to Allow. If a lock is involved, you must have the Lock permission set to Allow. For more information, see Team Foundation Server Permissions.

To merge files and folders

  1. In Source Control Explorer, right-click the team project, folder, or file version that you wish to merge with another team project, folder, or file version, and click Merge.

  2. In the Source Control Merge Wizard, in the Source branch box, either type the name of the team project source branch, or click Browse to go to it.

  3. In the Target branch drop-down list, select the desired target team project branch to which you want to merge the source branch.

  4. Select the type of changes you want to merge into the target branch by choosing either the All changes up to a specific version or Selected changesets option, and click Next.

    • If you chose All changes up to a specific version, in the Select the source and target branches for the merge operation step, select the version of the source items that you want to use.

      Changeset

      Merge by specifying a changeset version.

      Date

      Merge by specifying a date version.

      Label

      Merge by specifying a label version.

      Latest Version

      Merge by specifying the latest version.

      Workspace

      Merge by specifying a workspace version.

    • If you chose Selected changesets in the Select the source and target branches for the merge operation step, select the changeset you wish to merge.

      Tip

      If possible, click All changes up to a specific version, as doing so will reduce the likelihood of conflicts in future merge invocations.

  5. Click Next, and then in Perform the merge operation step, click Finish.

  6. Should merge conflicts arise, you must resolve them. For more information, see How to: Resolve Conflicts.

See Also

Tasks

How to: Resolve Conflicts

Reference

Merge Command
Merges Command

Concepts

Understanding Merging
Using Source Control Explorer

Other Resources

Branching and Merging Team Foundation Source Control