Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When did I last 'Get Latest' from TFS?

I have some version of code on my machine. I want to set up a second machine with the same version of code so I can pull down a shelveset based off this version. However, I didn't write down the day/time I last did get latest on my machine.

To get the right version, I need to know when exactly I last did 'get latest' on my machine. I'm sure there must be some way to do this, maybe on the command line. Does anyone know?

like image 590
TheSean Avatar asked Oct 14 '09 14:10

TheSean


1 Answers

Run this from inside the workspace in question:

tf history $/ -r -version:W -stopafter:1

This will tell you the highest changeset # that has been downloaded to your workspace. So long as your most recent Get operation was a full "Get Latest" (no path scope, no complex versionspec), that's all the info you need. Simply run tf get -version:1234 (replacing the version # with the changeset number TFS provides) in the new workspace to bring them in sync. Of course, you need to ensure the workspace mappings are comparable, etc...

If the assumption above don't hold and your workspace is in a more complicated state, the easiest way to replicate it is with labels:

# run in old workspace
tf label MyWorkspaceVersion $/ -r -version:W

# run in new workspace
tf get -version:LMyWorkspaceVersion
like image 126
Richard Berg Avatar answered Oct 10 '22 17:10

Richard Berg