Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does TFS "Remove Mapping" delete my files?

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.

like image 836
Peet Brits Avatar asked Jul 04 '12 06:07

Peet Brits


People also ask

How do I get rid of TFS workspace mapping for another user?

You need to get your TFS administrator to delete the workspace if you have no access to the account. You may be able to do it by calling "tf workspace" with the explicit user specified, but you need "manage other users workspace" permission. TF Sidekicks uses the same commands so would require the same permission.

How do I map a TFS to local folder?

From Visual Studio, go to the Team Explorer Connect page (Keyboard: Ctrl + 0, C) and then connect to the project. (If the project you want to open is not listed, choose Select Projects and then connect to the project.) Map the project to a folder on your dev machine. Map the workspace and get your code.


2 Answers

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
like image 64
daz-fuller Avatar answered Oct 26 '22 21:10

daz-fuller


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
like image 35
pantelif Avatar answered Oct 26 '22 22:10

pantelif