The process of merging items that are not directly branched from each other is called a baseless merge. For example, you might want to merge a change between two release branches, which are siblings of each other, without merging up to the parent branch.
When you perform a baseless merge, TFS does not have any information about the relationship of the files in the branches. For example, if you have renamed a file, this will be viewed as a deleted file and a new file will be added in the branch. For this reason you have to perform more manual conflict resolutions than when you perform a normal merge.
If you are the owner/administrator of your team project, you will know the relationships between the branches or items. From Visual Studio, you can only merge the branches or items that have a parent-child relationship. If your project contains branches or items that do not have this relationship, you require to perform baseless merge.
If you are not aware of all the relationships between the branches or items, you can evaluate whether you need to use a baseless merge as follows.
You use the TFS command line tool Tf.exe to perform a baseless merge.
Set the Workspace for both branches by performing a “Get Latest” operation on the branches to be merged:
Note that if no workspace is mapped, Visual Studio prompts you to select a folder on your local drive.
Tf merge /baseless <<source path>> <<target path>> /recursive
Tf merge /baseless c:\data\proj1 c:\data proj2 /recursive
If you need to merge specific versions of the code changes, you can use the version switch with Tf.exe as follows:
tf merge /baseless <<source path>> <<target
path>> / recursive /version:<<from Changeset>>~<<to
tf merge /baseless c:\data\proj1 c:\data\proj2 /recursive /version:C123~C125
You can also perform a baseless merge in Visual Studio
After you run the Tf.exe command, it displays a Resolve Conflicts dialog box with a list of the files that have conflicts.
Select each file and click Resolve.
In the Resolve version conflict dialog box:
In the merge tool, click the conflict regions in the upper pane or type in the lower pane to apply changes for each conflicting line.
After you have applied changes for all of the conflicts, click OK in the merge tool.
After all the conflicts have been resolved, click Close.
© 2021 Digcode.com