Is it possible to merge to a branch that is not a direct parent or child in TFS? I suspect that the answer is no as this is what I've experienced while using it. However, it seems that at certain times it would be really useful when there are different features being worked on that may have different approval cycles (ie. feature one might be approved before feature two). This becomes exceedingly difficult when we have production branches where we have to merge some feature into a previous branch so we can release before the next full version.
Our current branching strategy is to develop in the trunk (or mainline as we call it), and create a branch to stabilize and release to production. This branch can then be used to create hotfixes and other things while mainline can diverge for upcoming features.
What techniques can be used otherwise to mitigate a scenario such as the one(s) described above?
Choose Merge from Local to open the Source Control Merge Wizard: In the Source Control Merge Wizard, the Main branch is chosen automatically: Choose the latest version: Check Pending Changes/Included Changes.
Click the File menu, point to Source Control, point to Branching and Merging, and then click Merge. The Source Control Merge Wizard will displayed. 3.In the Target branch drop-down list, select the target team project branch to which you want to merge the source branch(first branch). 4.
In order to merge branches, right click a database in the Object Explorer pane and from the More source control options sub-menu, select the Merge branches option: This initiates the Merge branches dialog: Browsing through a repository, source and target branches can be set.
You need to reparent the branch. You can do this under the "Branching and Merging" menu on the context-sensitive menu when you right click on a folder in the Source Control Explorer.
tf.exe merge /recursive /baseless $/TeamProject/SourceBranch $/TeamProject/TargetBranch
I agree with Harpreet that you may want to revisit how you you have setup you branching structure. However you if you really want to perform this type of merge you can through something called a baseless merge. It runs from the tfs command prompt,
Tf merge /baseless <<source path>> <<target path>> /recursive
Additional info about baseless merges can be found here
Also I found this document to be invaluable when constructing our tfs branching structure Microsoft Team Foundation Server Branching Guidance
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With