TFS command for switching workspace

4.3k Views Asked by At

Is there a command to switch the active workspace from tf.exe ?
I have searched here and here.
But I do recall, I've seen it some time ago.

1

There are 1 best solutions below

2
PatrickLu-MSFT On BEST ANSWER

If you just want to change a workspace, you could not be able to do this through tf.exe command line. You should active you workspace window in Visual Studio:

  • In Visual Studio,click Source Control Explore.
  • From the Workspace dropdown select "Workspaces..."
  • The Workspace window appears
  • Click the WorkSpace name in Workspace window
  • From the popup list choose the Workspace name you want.

If you want to modify/update the workspace mapping, you could use tf workfold command, sample as below:

c:\projects>tf workfold /collection:http://servername:8080/tfs/collectionname /workspace:workspacename  $/projects/project_one C:\DifferentWorkfold

The above example maps the folder C:\DifferentWorkfold to the Team Foundation version control server folder $/projects/project_one and replaces the previous workspace mapping for the $/projects/project_one Team Foundation version control server folder.