13
votes

I want to create at button to get latest Version of my code from a specific folder without using Team Explorer -> Source Control tree every time.

So I am trying to make and external tools reference to run the tf.exe get command.

This is what I have so far.

enter image description here

When I run this is gives me this error:

Unrecognized command option 'workspace'

I cant figure out how to provide the workspace name?

3
Why take all this pain? You can right click on any solution/project node and click Get Latest. Or you can customize any toolbar and add the command there for easy access.Mrchief
Because we have resources and assemblies that exist higher than the solution folder, so that is not an option.Dan
I don't see you specifying the workspace option, so I'm not sure why you're seeing this error. Have you tried adding /workspace:WORKSPACENAME (replacing, obviously, WORKSPACENAME with whatever your TFS workspace name is...?) You do need the colon between the /workspace and the workspace name (which might lead to this error.)Edward Thomson
Yeah i tried variations of that, it didnt seem there is a /workspace flag on getDan

3 Answers

15
votes

You can omit the workspace name. tf.exe can resolve the server path and local path mappings because it stores workspace information locally.

The command you gave is correct (assuming you have $/Dev mapped):

tf.exe get /recursive $/Dev

However it's critical that you have $/Dev mapped directly (not just having children mapped) and unambiguously (you cannot have $/Dev mapped in two different workspaces) or else tf.exe will not be able to determine the correct local path.

Since a given local path can only be mapped to a single server path, the easiest way to do this is simply by specifying the local path you wish to get. For example:

tf.exe get /recursive C:\Dev

Again, this assumes that you have $/Dev mapped to C:\Dev.

5
votes

Command to get latest is

tf get /force /recursive /version:W<workspacename>

1 thing to be noticed is the workspace which you have not provided in the Initial Directory text box. Provide some path where it will download local copy of files (i.e. nothing but called workflow). Provide some path like C:\TFS\Apps

0
votes

Aside from the answer that Mrchief gave: if you install the TFS power tools you can use the contextmenü in windows-explorer to check-in/out, etc.