4

I'm trying to grab a project from TFS from the command line. I have its location on the server (starts with $/) and a directory I want to put it in.

I navigate to that directory, type tf workspace /new /s:<servername>, and enter a workspace name.

Next I type tf get /force /recursive /version:W<workspacename>, it returns 'All files are up to date', however it hasn't downloaded anything.

Also, I'd like to download the project into the workspace directory and then <projectname>, currently it makes a bunch of folders (based on $/the/long/path/to/the/<projectname> on the server).

Is there a way I can do that or do I need to move it after I'm done?

Luke Girvin
  • 13,221
  • 9
  • 64
  • 84
213897
  • 1,561
  • 4
  • 15
  • 16

1 Answers1

7

You also have to map the folders. Take a look at tf workfold

tf workfold /map:"$/ServerFolder/Path/To/Map","C:\LocalFolder\Path" /workspace:WorkspaceName /server:http://tfs:8080

Substitute anything in that command line that follows a colon into the correct value for your environment.

Also, you can map at any level that you want. For instance, you could map $/Project/Folder/Project1/Source to C:\TFSSource\Project1

Robaticus
  • 22,857
  • 5
  • 54
  • 63
  • cool, it looks like that (`tf workfold`) will solve the long path issue, but even after doing that I still get `All files are up to date` when trying to do `tf get /force /recursive /s: /version:W`, how can I fix that? – 213897 Apr 19 '11 at 18:23
  • 1
    Don't use the /version: parameter, and make sure to run the tf get from within the local folder that is mapped. – Robaticus Apr 19 '11 at 18:39