Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to map the TFS workspace to local by using Command Line Client

Tags:

cmd

tfs

I am trying to map the TFS workspace to local by using the below comment

tf workfold /map /login:username,pwd /server:http://servername:8080/tfs /workspace:'$/source/app/TFS_Label' 'C:\TFS_Label'

but am getting the error saying

An argument error occurred: workfold requires zero, one, or two path arguments.

kindly help on this issue.I am new to TFS.

like image 993
Elango Mani Avatar asked Feb 07 '23 20:02

Elango Mani


1 Answers

You're not quite passing in the correct arguments to TF Workfold Also the server parameter is deprecated.

If you're using TFS 2005 / 2008 then you need to use server, if your using TFS 2010 or above then you need to use collection instead. Having said that server will work if you have a single collection in TFS that is called "DefaultCollection" on newer versions of TFS

The syntax is

tf workfold /map serverfolder localfolder [/collection:TeamProjectCollectionUrl] [/workspace:workspacename] [/login:username,[password]]

So for TFS 2010 or newer your command should look something like this

tf workfold "$/source/app/TFS_Label" "C:\TFS_Label" /map /login:username,pwd /collection:http://servername:8080/tfs/defaultcollection /workspace:"MyWorkspaceName"

For older versions of TFS use

tf workfold "$/source/app/TFS_Label" "C:\TFS_Label" /map /login:username,pwd /server:http://servername:8080/tfs /workspace:"MyWorkspaceName"

A workspace is the container for the folder mapping so if you have an existing workspace then you can use that. If not then you can create a workspace using the TF Workspace /new

like image 115
James Reed Avatar answered Feb 14 '23 08:02

James Reed