To start working with source control, you must establish a workspace. A workspace is a local copy of the files and folders on the server. When you add, edit, delete, move, rename, or otherwise change any source-controlled item, your changes are isolated in your workspace where you can safely build and test your changes. When you perform a check-in these changes are committed to the server and available outside your workspace.
A workspace consists of a series of mappings. Each mapping associates a folder in the server that has a local folder on disk. To obtain a local copy of the files on the server, create a new workspace, specify the mappings for the workspace, and then use the get command to populate your workspace with source files.
Before you can perform any Team Foundation source control commands on your computer, you must create a workspace into which the output of your operations can be persisted and from which you can commit them to the server by checking them in.
To create a workspace to manage your source-controlled files
-
Click Start, click All Programs, point to Microsoft Visual Studio 2005, point to Visual Studio Tools, and then click Visual Studio Command Prompt.
-
Type mkdir c:\projects.
-
Type cd c:\projects.
-
Type tf workspace /new /s:servername, where servername is the name of your Team Foundation Server, for example, tf workspace /new /s://team1server and then press ENTER.
Note |
|---|
| If the default workspace name already exists, you must type a different name, for example "cmdwalkthrough." |
-
In the Create Workspace dialog box, map to the desired team project, and then click OK. For more information, see Working with Source Control Workspaces.
You can see all the workspace that you have created on the current computer by typing tf workspaces at the command prompt. For more information, see Workspaces Command.
A workspace definition that lists all files in the workspace, the version upon which each is based and also its current status, is stored on the Team Foundation Server. Because workspace definitions are stored on the server, any user who has the correct permissions can duplicate your exact working environment on their computer, minus any pending changes. For more information about how to do this, see Get Command.