Adding a working folder mapping to a TFS workspace

*Prerequisite: You will need to be connected to a Team Foundation Server and you will need a TFS workspace before proceeding with this step.

Downloading files from TFS source control is a two step process. First you must add a working folder mapping to your TFS workspace (described here); then, you must tell the server to download the files (see User Guide section, Get Latest version), or upload files (see User Guide section, Adding local files to source control.)

When you add a working folder mapping to a TFS workspace, you specify the Local and Server directories you wish to relate. The Local folder should have the same name as the Server folder.

Method 1
  1. From the workspaces drop-down menu located in the Teamprise Explorer window menu bar, select Manage workspaces...

  2. In the Manage Workspace dialog, the workspace you created earlier is highlighted by default. Click Edit to bring up the Edit Workspaces dialog.

  3. Since we have not yet added a working folder mapping, the Working Folders section of the window is empty. Click the Add button to bring up the Working Folder dialog.

  4. In the Working Folder dialog, click the Browse button to bring up the Browse for Folder dialog. Select your Repository folder. (This will probably be a folder somewhere in the Team directory, not the Team directory itself). Select your Local Folder. (If you are working in Windows, you may have to select the Make New Folder in the Browse dialog to create a name that matches the server name; don't worry that this is an empty folder.) Keep the Status set to Active for now. Click OK.

    Note: By creating a working folder such as TFS_trunk you can map more than one project from the Team_project/trunk directory to this location on your computer as long as you create a new subdirectory. You should avoid mapping a server directory to a local directory of a different name.

    In the example below both the Repository (i.e. the Server) Folder and the Local Folder are named com.mediamill.help. Click OK.

  5. Anytime you change a working folder mapping a dialog prompts you to perform a get. This means you can download files that exist in the TFS repository folder to your local folder using the Teamprise Get Latest task. Click OK.

  6. Click OK to return to the Teamprise Explorer window and review your changes in the Source Control view. Once you have set a workspace mapping between the local and repository folders, you will see the local path displayed above the Name column in the Source Control view where it previously displayed Not Mapped. Remember directories and files will remain dimmed and you will be unable to perform a check out action until you issue a Get Latest action to retrieve the server files to your local working folder.

    Note: After you create a TFS workspace mapping, the file status in the Latest column changes from Unmapped to Not downloaded. For more information on Latest status see the User Guide section, Source Control view > Display Latest status.

    Once you you create a mapping in a workspace will not be required to map these directories when you login again; Teamprise restores your TFS workspace, it's mappings, and all pending changes each time you login.

Editing your Working Folder Mappings

If you decide to change your mapping to another local working directory, you will need to remove the workspace and create a new one and repeat steps 1 - 6 above; then issue a Get Latest action to populate the new location with the latest files from the server.

Method 2

If you are currently logged in and you have already created a workspace, you can use the following shortcut to create a workspace mapping. This method bypasses the Edit Workspaces dialog and combines several steps from Method 1 into one easy operation. Be careful you are in the TFS workspace to which you wish to download files.

  1. In the Source Control view, locate the Team project or server folder you wish to download; right-click and select Get Latest version.

  2. In the Working Folder dialog add your working folder paths (step 4 above.)

  3. To see your workspace mappings, select File > Manage Workspaces... Select your workspace and verify the new mapping in your current workspace is correct.
Adding and Removing a Cloak Mapping

When you want to prevent the system from retrieving all directories in a folder when you issue a Get Latest, (if for example you don't work on high resolution image files and you want to conserve local disk space by leaving these out), you can tell the server which directories not to retrieve during a Get Latest action, by creating a Cloak mapping.

There are two rules to cloaking:

  1. You can not cloak a directory whose parent is not mapped.
  2. You must map the local folder to a new directory (not in the current parent; for example, c:\temp_cloaked\folder_name). Note: No directories will actually be downloaded here.

To create a cloak mapping complete the following:

  1. Complete steps 1 - 3 above to add a mapping.

  2. In the Working Folder dialog, map a server folder you wish to cloak to a local folder. Note: Select a local folder path outside the current parent.

  3. Click the Status drop-down menu. (By default it's set to Active; select Cloaked.) Click OK.

  4. The Edit Workspaces dialog displays the new cloak mapping. You will not see a path to the Local Folder in the cloak mapping. Click OK.

  5. A dialog prompts you to return to the Source Control view and issue a Get Latest on the parent containing the cloaked directory. The system removes the directory from the local folder in which it was previously mapped, dims it from the Source Control view, and changes its Latest status to Cloaked.

    Browse to your local directory which previously contained the cloaked directory to confirm the system removed it. Note: If you look in the cloaked directory, you will see it is empty.

  6. To remove a cloaked mapping, simply return to the Edit Workspaces dialog (steps 1 - 3 above), select the cloak mapping and click Remove. A dialog prompts you to return to the Source Control view and issue a Get Latest on the parent containing the cloaked directory. Once you issue a Get Latest, the directory previously cloaked is restored to its parent directory on your local computer.

Related Tasks:

Teamprise Explorer window
Creating and removing a TFS workspace
Adding local files to source control