TFS reparent to be a grandchild

1k Views Asked by At

Been trying all I can think of for days to get this to work. Baseless merges, reparenting, branching and then reparenting.

I would like to reparent a branch to be the child of one of it's children and break the relationship between that branch and its parent.

In the image below, I would like to move Cassidy-Main and Bohem-Main to be a child of Cassidy-QA and Bohem-QA respectively. Then reparent Cassidy-QA and Bohem-QA to be children of Acme-QA.

Branch Hierarchy

Thanks in advance for any help/advice/solutions!

2

There are 2 best solutions below

1
MrHinsh - Martin Hinshelwood On

Once you have completed a baseless merge between where it was and where you want tit to be you will be able to reparent.

There is however no way to remove the old relationship.

2
PatrickLu-MSFT On

I have create a simple example for your reference:

The original branch hierarchy The original branch hierarchy

When you want to reparent Main-branch3.0-child2 to Main-branch2.0, you will get below screenshoot: enter image description here

To point to another parent, you need to perform a baseless merge. Do a baseless merge of the new parent to the target branch in cmd.

tf merge /recursive /baseless  "$/MyFirstProject/Main-branch3.0-child2" "$/MyFirstProject/Main-branch2.0"

After this, it will shows the current parent and the new parent. Select the new parent and press “Reparent”.

enter image description here


Update

Finally, I got what your described as below:

enter image description here


Update 2

To perform the baseless merge, first you need a right workspace mapping. And run the tf command in the local workspace:

enter image description here

For example: enter image description here

After that check in the changes in pending change page.