Dela via


How to: Merge Files and Folders

Team Foundation version 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 locate 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 versions of the source items page, select the version of the 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,on the Select changesets to merge into the target branch page, select the changeset that you want 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, on the Perform the merge operation page, click Finish.

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

See Also

Tasks

How to: Resolve Conflicts Between Two Files

Concepts

Understanding Merging

Using Source Control Explorer

Reference

Merge Command

Merges Command

Other Resources

Branching and Merging Team Foundation Version Control