Share via


Understanding Merging

Merging combines the changes that were made in two distinct branches. A merge operation takes name changes, file edits, file additions, and file delete or undelete changes that you made in the source branch and integrates them into the target branch. If items have been modified in both the source and target branches, you are prompted to resolve the conflicts. For more information, see How to: Resolve Conflicts Between Two Files.

Use Source Control Explorer or the Merge Command to perform a merge operation. For more information, see How to: Merge Files and Folders.

The Merge Operation

During a merge operation:

  • Merge identifies any added files or folders in the source branch and tries to add the corresponding items to the target branch.

    Note

    If you try to merge an item from a source branch that has an identical name with an item in the target branch, Team Foundation performs an implicit baseless merge. However, if you use the /noimplicitbaseless option with the tf merge command, the namespace conflict cannot be resolved by using a baseless merge. You must rename one of the files and run the merge operation again to resolve the conflict.

  • Merge reviews the history for each item in the source branch that also exists in the target branch. For each item, changes that were made in the source branch that do not exist in the target branch are merged into the target branch. If the item has already been modified on the target branch, a conflict is reported. For information about resolving merge conflicts, see How to: Resolve Conflicts Between Two Files.

  • During a merge operation, you have the choice of merging either specific versions of items, or all changes. For more information, see How to: Merge Files and Folders.

Merging Changes

Use Source Control Explorer or the Merge Command to perform a merge operation. For more information, see How to: Merge Files and Folders.

Merge History

Team Foundation version control keeps a historical record of all merges. You can review this information from the command line using the Merges Command.

See Also

Tasks

How to: Associate a File Type with a Merge Tool

Concepts

Using Source Control Explorer

Reference

Branch Command

Branches Command

Other Resources

Branching and Merging Team Foundation Version Control