18

I wanted to check out an older version of the project in a different folder because I did not want to disturb my modified local content, so I thought I would just remove the mapping and map it to another folder and later map it back.

I was shocked to see that it started deleting my files!!! I quickly clicked cancel. Luckily it appears that it did not delete my modified and local files.

How am I supposed to do a thing like this?

This happened with Visual Studio 2010's Team Foundation Server, but I am sure it applies to all versions.

7
  • This behavior is normal for VS 2010 and TFS. Read msdn.microsoft.com/en-us/library/ms245474.aspx
    – Jehof
    Jul 4, 2012 at 7:04
  • I understand your pain in your title (and +1 for your frustration), but I felt the need to edit it because this kind of title isn't going to help your question be easily lookup-able down the road . Jul 4, 2012 at 7:15
  • I just needed a moment to vent :-)
    – Peet Brits
    Jul 4, 2012 at 7:19
  • 3
    Jehof, one would think that "remove WORKSPACE" and "remove workspace MAPPING" would behave differently. Now I trust TFS even less.
    – Peet Brits
    Jul 4, 2012 at 7:23
  • Popular Question in eight months. Cool.
    – Peet Brits
    Mar 6, 2013 at 6:01

2 Answers 2

12

It does it because TFS is useless. You could however use the "TF.exe" command line to get around some of the limitations of the UI.

The TF.exe command should be under something like the following, so it's probably worth adding this directory to your path.

C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\tf.exe

You can then choose a suitable location on your drive, create a new workspace and then get the code at a specific version (or just the latest)

C:\my_temp_location> tf.exe workspace /new <workspace_name> /collection:<server_location>
C:\my_temp_location> tf.exe get <source_location> /version:<changeset> /recursive

If you want to see a list of workspaces you currently have then you can just run the following command:

C:\> tf.exe workspaces
5
  • 3
    Yep, agreed on useless. How do I specify credentials? Do you have a link to more commands?
    – Peet Brits
    Jul 4, 2012 at 7:33
  • Never mind, I found it: /login:<domain@user>,<password> - msdn.microsoft.com/en-us/library/hh190725.aspx
    – Peet Brits
    Jul 4, 2012 at 7:44
  • 1
    You can run tf.exe help to see a full set of commands or something like tf.exe help get to see help for that command. I feel your pain though, I really hate using this product, having come from using Subversion this feels like a step backwards
    – daz-fuller
    Jul 4, 2012 at 7:53
  • Thanks for the help. I also started with svn on Linux.
    – Peet Brits
    Jul 4, 2012 at 8:04
  • Team Foundation Sidekicks is a nice GUI to do such tasks: attrice.info/cm/tfs Dec 22, 2012 at 18:26
6

A straightforward way to do what you 're after, without generating any new workspace, is to:

  • Shelve your pending changes into a new shelveset
  • Get the specific version you 're looking for & do any reviews
  • Get latest once you 're done
  • Unshelve your previously shelved changes
2
  • Could be useful, but I cannot, for example, compare the two folder structures or copy missing files.
    – Peet Brits
    Jul 4, 2012 at 11:49
  • 3
    I see what you mean. Another way to compare the folder in between different versions, is to (1) select "View History" from the Source Control Explorer, then (2) highlight two different changesets (press Ctrl) and finally (3) right-click to select "Compare..".
    – pantelif
    Jul 4, 2012 at 12:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.