How do get specific version from a different branch to my branch on TFS?

53 Views Asked by At

I created a branch from the main branch for example branch A. Now is there a way to get specific version of the main branch in branch A? I know that i can create branch from specific version of the other branch but i don't know how to do that for an existing branch that has been already created.

1

There are 1 best solutions below

2
Ziyang Liu-MSFT On BEST ANSWER

If you are using TFVC, you can use tf merge command. See the detailed info about this command from Merge command (Team Foundation Version Control).

Open a command prompt from your workspace folder. The following example merges changeset 11 from Main branch into branchA branch.

tf merge /version:C11~C11 Main branchA /recursive

In changeset 11, I added a test3.txt file into the Main branch. After running the above command, you can see the test3.txt file in branchA. Then you can check in to reflect your server. enter image description here

You can also do it in VS. Right click your Main branch -> Branching and Merging -> Merge -> Select Selected changesets. enter image description here