TFS Get Specific Version into separate folder
Asked Answered
R

4

113

I'm currently working on a project with TFS source control. We've just gotten in a bug report for an older version of the code, and I need to pull down that version of code to test it out. My first thought would be to "Get Specific Version" to pull down the code, but I'd rather not get that version into my current workspace directory.

Is there an easy way to "Get Specific Version" into a separate (e.g. temporary/throw-away folder), so I can quickly look into this bug in the older version of code, and not disturb my current work?

Retro answered 20/10, 2009 at 21:36 Comment(0)
R
143

I just found one easy way to do this: Create a new Workspace in TFS pointing to a separate folder, then switchover to this new workspace and do a Get Specific Version here.

Makes sense now, I just hadn't ever tried that.

Retro answered 20/10, 2009 at 21:48 Comment(4)
Alternatively you can temporarily change the folder mapping for your project, but that is not as clean the solution proposed by Andy.Detector
Note: to get just the files listed in the changeset I had to use the command-line version. The visual interface retrieved all the files. I used this command: ** tfpt getcs /changeset:#### **Penhall
I can't get this to work. I added a new workspace for just that folder (while keeping the root workspace the same), but it didn't change the workspace.Gaitan
Here's a link for instructions on how to Create and work with workspaces which helped me in doing Andy's method.Baillieu
M
5

OK, this is a very old question but still one that comes up. An alternative would be to shelve any changes you currently have, then undo changes locally so you are at the most up to date version from TFS, and then do your Get Specific Version. Once you're finished with it you can then get latest (if you're worried about it, you can dump the code you have locally first) and unshelve your changes again.

It's not without risk but given TFS's irritating and outdated workspace model it's about the best you can hope for without going to the trouble of mapping a whole new workspace or other faffing about.

Mycostatin answered 29/9, 2016 at 10:3 Comment(0)
E
3

You can create a branch with version by

  • Change Set
  • Latest Version
  • Label
  • Date
  • Workspace Version

Then use that branch for fixing the bug and merge back the changes if required or release the branch itself.

Extractive answered 14/6, 2017 at 7:13 Comment(0)
H
1

For making edits to a single file, here's a quick hack from within Visual Studio:

  1. Open Source Control Explorer
  2. Drill down to desired file
  3. File > Source Control > View History
  4. Select desired version (Changeset)
  5. Toolbar/Context Menu > Compare
  6. Click in left pane, Select All, Copy, paste into Your Favorite Editor and save
Hearthstone answered 22/2, 2018 at 19:48 Comment(2)
That might be a lot of work if you need the differences in a directory tree.Unavailing
Agreed: this is really just a single-file solution.Hearthstone

© 2022 - 2024 — McMap. All rights reserved.