How to download TFS shelveset
Asked Answered
P

3

33

I need to download a shelveset from TFS to a local folder. Is there any tools or add-in for Visual studio 2010 to download shelveset

Pallium answered 26/10, 2012 at 7:15 Comment(2)
What exactly is it that you're trying to do that you can't do with Visual Studio or tf.exe?Tarsier
I agree with Edward Thomson. This question stipulates part of a solution to an unstated problem. Unshelve inherently updates the "local folder" (local workspace) it's unclear how that fails to meet your needs.Chiropractic
N
48

If you just need to get the files from the shelveset to your local folder, this is a normal process and called Unshelve. It downloads the files to your local folder.

enter image description here

For example, before unshelve you had the following in your local folder:

  • File 1
  • File 2

The shelveset has:

  • File 1 (Modified)
  • File 3 (Created)

After unshelve there will be:

  • File 1 (Updated)
  • File 2
  • File 3 (Added)

If you need to have only the files from the shelveset in your workspace folder without anything else, one of the ways would be:

  1. Create new workspace, but do not download anything (i.e. do not get the latest version)
  2. That should create an empty local folder
  3. Do unshelve by using either Visual Studio or tf.exe
  4. You should have only the files from the shelveset

You can find more about managing shelvesets here: Suspend Your Work and Manage Your Shelvesets (MSDN)

Natant answered 27/10, 2012 at 14:28 Comment(2)
this will not work if shelveset is created for new and unmapped solution. I got "No appropriate mapping exists for" errorsNonesuch
@Nonesuch I ran into problems with creating new work space, added an alternative answer.Slushy
F
4

Using command prompt, we can get a dump of the files :

set shelveset=<ShelvesetName>
set temppath=c:\temp\%shelveset%
md %temppath%

for /f "delims=;" %t in ('tf status /shelveset:%shelveset% /format:detailed ^| find ^"$^"') do tf view %t /shelveset:%shelveset% /noprompt > %temppath%\%~nxt

Note that this gives a flat structure and will rewrite if there are files with same name.

Firewarden answered 29/3, 2018 at 5:58 Comment(0)
S
2
  1. Close Visual Studio
  2. Rename the folder, e.g add postfix original to the folder name so "SolutionX" folder becomes "SolutionX - Original"
  3. Make a "SolutionX" folder again, this is going to be empty
  4. Open VS, unshelve shelvset1, "SolutionX" will now only have shelvset1 files
  5. Close VS (this might not be needed)
  6. Rename "SolutionX " e.g. to "SolutionX Shelveset1"
  7. Make a "SolutionX" folder again, this is going to be empty
  8. Open the VS and Undo Pending Changes
  9. Unshelve shelvset2, "SolutionX" will now only have shelvset1 files
  10. Close VS, Rename "SolutionX" folder to "SolutionX Shelveset2"
  11. Rename "SolutionX - Original" folder to "SolutionX"
  12. Open the VS and Undo Pending Changes
  13. Use your compare tool to compare "SolutionX Shelveset1" and "SolutionX Shelveset2"

    If you find that some of the steps are not needed, let me know to update this, I tried the first answer, ran into problems and had to come up with this instead.

Slushy answered 22/1, 2018 at 7:16 Comment(1)
TY! Very helpful for those of us lacking permissions to create workspaces to accomplish the same outcome.Panel

© 2022 - 2025 — McMap. All rights reserved.