Workfold Command

Creates, modifies, or displays information about the mappings between your workspace folders and the Team Foundation source control server folders.

tf workfold localfolder

tf workfold [/workspace: workspacename]

tf workfold [/server:servername] [/workspace: workspacename]
  serverfolder

tf workfold [/map serverfolder localfolder] [/server:servername]
 [/workspace: workspacename] (serverfolder|localfolder)

tf workfold /unmap [/server:servername] [/workspace: workspacename]
 [/recursive] (serverfolder|localfolder)

tf workfold /cloak (Team Foundation source control 
serverfolder|localfolder) [/workspace: workspacename] [/s:servername]

tf workfold /decloak (serverfolder|localfolder) 
[/workspace: workspacename] [/s:servername]

Parameters

Argument Description

servername

The user-provided value for the /server option. Example: teamfoundation2.

workspacename

The user-provided value for the /workspace option.

serverfolder

Specifies the name of a Team Foundation source control server folder.

localfolder

Specifies the name of a local folder.

Option Description

/server

Identifies the Team Foundation Server. This option is required if the command is invoked from a directory that is not mapped to a workspace.

/workspace

Specifies the name of the workspace to work in.

/map

Specifies an association between a local folder and the Team Foundation source control server folder. By default, the workfold commands uses this option even if unspecified unless /unmap, /cloak, or /decloak is specified.

/unmap

Specifies that the specified folder mapping should be deleted.

/cloak

Specifies that the folder should be excluded from the workspace view.

/decloak

Decloaks a folder so that the folder can be retrieved into the workspace.

Remarks

You can use the workfold command of the tf command-line utility to create and edit workspace mappings. A workspace mapping creates a client-side folder into which all files and subfolders in the Team Foundation source control server folder are retrieved when you perform a tf get operation, unless the client-side folder is cloaked.

Options for Workspace Mapping

A workspace mapping is a list of mapped and cloaked items. You can add Team Foundation source control server items to the mapped list in the workspace using the /map option. You can also exclude an item from the workspace explicitly by using the /cloak option. You can only cloak items which have a mapped parent. Cloaking is an effective way to improve the speed of batch Get operations and to conserve space on disk but should be used with discretion. To avoid compilation and integration problems, you should only cloak those items that you know to be outside the scope of your current and future projects, such as images and external documentation files.

You can use the /unmap and /decloak options to selectively delete mapped and cloaked entries from the workspace mapping.

How Workspace Mappings are Applied

By default, workspace mappings are applied recursively. When you map a local folder to a Team Foundation source control server folder, a mapping is implicitly created between all its current and future subfolders. For example, if you map $/projects to c:\projects, subsequently add a project called $/projects/project_one, and then perform a get of the workspace, Team Foundation automatically creates a local working folder named project_one in the C:\projects directory.

In this example, you can override the automatically-created mapping between $/projects/project_one and C:\projects\project_one by using the workfold command as follows:

tf workfold $/projects/project_one C:\DifferentWorkfold

Examples

The following example displays the mappings for the workspace in which c:\projects resides.

c:\projects>tf workfold

The following example maps the root of your Team Foundation source control server to the current directory.

c:\projects>tf workfold $/ .

The following example cloaks the c:\projects\lib folder.

c:\projects>tf workfold /cloak c:\projects\lib

The following example displays the mapping for the local file word.cs.

c:\projects>tf workfold word.cs

The following example maps the folder C:\DifferentWorkfold to the Team Foundation source control server folder $/projects/project_one and deletes previous workspace mapping for the $/projects/project_one Team Foundation source control server folder.

c:\projects>tf workfold $/projects/project_one C:\DifferentWorkfold

Security

To use the workfold command, you must be the owner of the specified or implied workspace or have the global Administer workspaces permission set to Allow. For more information, see Team Foundation Server Permissions.

See Also

Tasks

Walkthrough: Working with Team Foundation Source Control from Command Line
How to: Cloak and Decloak Folders in a Workspace

Reference

Command-Line Syntax
Workspace Command

Concepts

Working with Source Control Workspaces

Other Resources

Tf Command-Line Utility Commands