Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TFS reparent branch - only options shown are current parent and "no parent"

Tags:

tfs

I thought the point of branch reparenting in TFS was I could set any parent branch I wished when I have a good reason to do so.

However when I look at reparenting a feature-branch to belong to a different release branch, the dialog shown only contains two items:

  • the current parent branch
  • "no parent"

This doesn't seem very useful. Am I misunderstanding the feature or is there something I can do to reparent to other branches?

like image 623
Mr. Boy Avatar asked Apr 14 '16 10:04

Mr. Boy


2 Answers

Yes, it's the normal phenomenon. Usually, you will only see the parent branch," no parent" and child branch.

If you want to reparent to other branch, you must set a relation ship between the 2 branches first.

The solution is baseless merging: tf merge /recursive /baseless new target branch child branch After that , you will see the new target branch in the dialog. More details info and steps please refer this blog: Reparent of a TFS Source Controlled Branch.

like image 180
PatrickLu-MSFT Avatar answered Sep 21 '22 09:09

PatrickLu-MSFT


As mentioned by @StingyJack, I've been trying to re-parent a branch, by creating a relationship with a baseless merge, but without actually updating any of the files on the child branch during the baseless merge.

Using the TF merge command, with the /discard switch set, has allowed us to create a relationship between the branches, without modifying the child branch and starting the relationship off with no pending merges between them:

tf merge $/Path/To/NewParent $/Path/To/Child /baseless /discard /recursive

You can then simply re-parent the child branch to the new parent branch.

(I had first tried merging whitespace or comment changes across, and ignoring the rest of the baseless merge changes, but this didn't create a relationship to enable the re-parenting (and undoing 70 000 changes took 45 minutes+ each time)).

like image 24
Ted Avatar answered Sep 18 '22 09:09

Ted