Search code examples
tfsversion-controlrevisionsource-control-explorer

TFS Server keeps deleting content in old existing workspace, and still retains old local code modifications in new workspace


I'm trying to get a fresh copy of the source code from the TFS server, and I already have an existing workspace. However, I want to leave the existing workspace as it is because I have some local code modifications that I want to keep in the existing workspace.

I just want a brand new workspace that will have a fresh copy of the source code from the TFS server

In TFS Source Control Explorer, I righted-clicked on the source control folder, and I navigated along the following options.
enter image description here

However, when I try to do remap, 1) TFS will delete a lot the content in my existing workspace 2), and furthermore he creates the new workspace but the new worskpace some how retains my existing local code modifications.

a) How do I maintain my existing workspace with the local code modification intact? b) How do I create a new workspace in such a way that I get a fresh copy of the source code from the TFS server?


Solution

  • You just need to Add a new workpace but not remap.

    Basically remap means the workspace existing there and needs map to another local folder, as a workspace can only be mapped to one local folder, when you select Remove Mapping... by default it will remove the contents and only keep the changed files there which not be checked in yet. Then map the existing workspace to a new local folder. It's the expected behavior.

    Based on your requirement, you just need to Add a new workspace and map to a new local folder, and keep the existing workspace there.

    To add a new workspace:

    From the Team Explorer home page --> Under Solution --> Workspace --> Manage Workspace --> Add. (Refer to Add, edit, or remove a workspace for details)

    enter image description here