Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Team Foundation Server switch between branches

Tags:

Can we switch between branches in TFS

what i want is i downloaded a working copy and now I want to switch to different branch without downloading everything, because for large projects it will take lot of time since developers spend lot of time downloading

Is it possible, if not any workaround ??

like image 373
user804401 Avatar asked Apr 20 '12 04:04

user804401


People also ask

Does TFS support Branching?

The release isolation TFS branching strategy introduces releases branches from the main. This strategy helps teams manage concurrent releases. Instead of releases just being a copy of the main branch, teams create a new branch to support each release.


2 Answers

You can switch branches from the command-line client (only downloading the differences) by changing your workspace mappings and using the /remap flag to the get command:

tf workfold /map $/Branch1 C:\Work tf get C:\Work /version:T /recursive tf workfold /unmap $/Branch1 tf workfold /map $/Branch2 C:\Work tf get C:\Work /remap /version:T /recursive 
like image 163
Edward Thomson Avatar answered Sep 27 '22 22:09

Edward Thomson


In TFS branches are "physically" present in the Source Control, they're like "special folders". So you can totally choose what branch you get locally by targeting the right folder for your get.

If you have for instance:

  • Projects [folder]
    • ProjectA [folder]
      • Dev [Branch]
      • V1 [Branch]
    • ProjectB [folder]
      • Dev [Branch]
      • V1 [Branch]

and you want to get at the "Projects" level with only the content of "Dev", you can create mapping in your Workspace definition to cloack the V1 branches of ProjectA and B.

like image 30
Nock Avatar answered Sep 27 '22 20:09

Nock