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?

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

2 Comments

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:<servername> /version:W<workflowname>, how can I fix that?
Don't use the /version: parameter, and make sure to run the tf get from within the local folder that is mapped.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.