15

At the moment when unmapping a source on TFS Source Control in Visual Studio 2010, the local downloaded files are removed automatically.

How can I keep them untouched?

Nam.

Nam G VU
  • 33,193
  • 69
  • 233
  • 372
  • A bit of a gamble, but you can also "Cancel" the progress on deleting local items after you unmap. The unmap still occurs but it will leave items it hasn't yet deleted locally. – AaronLS May 25 '18 at 20:12

2 Answers2

23

In VS2012

"You can remove the mapping in the Manage Workspaces dialog (File -> Source Control -> Advanced -> Workspaces...) Pick your workspace and select edit, remove the entry for that mapping. Then hit OK. When prompted to perform a Get you can say "no" and the items will stay on your local disk until you next perform a Get."

I added some more information on to it.

Source: Remove Mapping

Just in case anyone else need help with this because i went for hours searching for the solution....and this is the way to see all the mappings you have and remove them if wanted without deleting local files.

Mindless
  • 2,352
  • 3
  • 27
  • 51
  • 7
    When I follow those exact steps in Visual Studio 2017, then go to Source Control Explorer and select the folder I supposedly un-mapped, it still says it's mapped (lists a Local Path). Why is it so difficult to un-map in Visual Studio?? – jbyrd Apr 28 '17 at 19:58
4

I have not seen this behavior. When un-mapping, are you choosing to re-download all files in the workspace? If so, choose not to do that, and the files should be preserved locally. Keep in mind that TFS is no longer tracking changes at that point, so it could get you into a lot of difficulty if you inadvertently make changes to those files.

What kind of process are you trying to implement that you need to keep these files around after an unmap? Maybe there's a different way to accomplish what you need?

--EDIT-- When you're doing this, files are just files, so you could:

  • do a Get of all files in that workspace
  • copy them to another folder on your hard drive
  • map that new folder
  • Do an "add files" on everything in the new folder structure
  • check in.

You will have to rebind all of the projects/solutions to source control when you do this.

Robaticus
  • 22,857
  • 5
  • 54
  • 63
  • 1
    I need to copy those codes to a new TFS server. So I need to unmap them with the `oldtfs` and remap them with the `newtfs`. – Nam G VU Feb 21 '11 at 10:18
  • Ok. sounds reasonable. When it prompts you to re-get all of the files in the workspace, how are you answering? See edit above for another approach . . . – Robaticus Feb 21 '11 at 13:48