|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.|
Merging is the process of combining the changes in two distinct branches. A merge operation takes changes that have occurred in the source branch and integrates them into the target branch. Merging integrates all types of changes in the source branch including name changes, file edits, file additions, and file delete and undelete changes. If items have been modified in both the source and target branches, you will be prompted to resolve conflicts. For more information, see.
Merging can be conducted through Source Control Explorer, or from the command line using the.
What Occurs During a Merge Operation
During a merge operation, the following actions occur:
The merge will identify any added files or folders in the source branch and try to add the corresponding items in the target branch.
A namespace collision can occur if the item being added from the source branch shares an identical name with an item that has been added to the target branch. Team Foundation does not handle the resolution of this type of conflict; however, an error message is logged.
The merge will review 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 will be merged to the target branch. If the item has already been modified on the target branch, a conflict will be detected. For information about resolving merge conflicts, see.
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 Changes
Merge operations can be performed from either the Source Control Explorer or the command line using the . For more information, see .
The Team Foundation source control server keeps a historical record of all merges that have occurred. You can review this information from the command line using the.