Search code examples
version-controltfsrevisionteam-explorer-everywhere

How to check out (get) a specific version/revision of source using Team Explorer Everywhere CLC


I need to be able to check out a specific version of the source from TFS using Team Explorer Everywhere command line client.

$ tf workspace -new MyWS -collection:http://example.com/tfs/DefaultCollection
....
$ mkdir myws
$ tf workfold -map -workspace:MyWS $/Project $(pwd)/myws
...
$ cd myws
$ tf get
...

The above sequence of commands will fetch/check out the latest version from TFS. How do I force TEE command line client to check out/get me a specific version of the source?


Solution

  • The tf get command takes a "-version:" option where the changeset number can be specified:

    $ tf get -version:12345
    

    For more information, see:

    $ tf help get
    

    The help text does not specify the format of the "-version:" value, but plain numbers work for me in order to specify changesets.