Working with Workspaces in TFS 2010 – Part 1

Hello my dears,

First of all, please accept my apology for being late in writing a new post, I was a in a long business trip and I am so happy to catch you again through a new post, I will take today about dealing with workspaces which is source control most important part, so lets start out journey!

Create Workspaces to Get Files for the First Time

Workspaces map folders in Visual Studio Team Foundation Server to folders on your local computer, which is necessary if you want to work on your team’s version-controlled files. When you first download, or “get”, local copies of files from Team Foundation Server, you specify a local folder for them. Although you may not notice at the time, this action creates a default workspace that maps the selected server folder with the selected local folder and saves that mapping.

However, instead of using the default workspace, you can create a workspace manually. This option is the best if you plan to work with version-controlled files often or you plan to work with files in more than one folder.

When you create a workspace manually, you choose specific, version-controlled folders to form a logical, isolated group. You can then perform the following actions on the files that are contained in those folders as a group:

  • Refresh your local copies to make sure that you have the most recent versions so that you can build and test your changes locally.
  • Check out files to modify.
  • Check in, shelve, or undo pending changes.
  • View the pending changes that other team members have made so that you can anticipate conflicts before you check in changes.

This topic describes workspace terms, demonstrates how to create a complex workspace, and explains common problems with workspaces. For more information about how to get local copies of files or how to add files to version control

When you create a workspace, you should consider the following guidelines:

  • If you want to work with files from a single folder, map to one that is as close to the level of the team project collection as you can but no closer than you must. That way, you will get all the files that you need without getting many that you do not need.
  • Create a complex workspace that contains multiple mappings only if you want files from disparate areas in your source-code tree or if you want to use cloaking to restrict the number of files that you get from a folder.
  • If you work in multiple branches, create a separate workspace for each branch to isolate the branches on your local computer.
  • If you intend to create a local build to test your changes before you check in the files, map all the files that are necessary for the build, not just those you intend to edit.

Workspace Terms

When you start to work with workspaces, you should understand the roles that are played by local folders, server folders, and the workspace that maps the two.

Server  folders: contain the code and other files for your team project. Team members can      share the version-controlled files, track changes to them, and revert to earlier versions of them. To list the server folders for your team      project, open Team Explorer, and then double-click Source Control.

Local folders :contain files that you “get” or check out from the version-control server to your local computer. When you get a file, you download a read-only copy of it to your local folder. When you check out a file, you download a copy that you can edit. When you save edited files, the changes are saved locally and are committed to the server only when you check in the files.

Workspaces: map server folders to local folders. You can create a simple workspace that maps a single server folder to a single local folder, or you can create a complex workspace that includes multiple mappings. If a workspace includes multiple      mappings, it groups folders into a single unit upon which you can perform actions, such as getting the most recent versions from the server or checking in changes. To list the mappings for a workspace, open the File menu, click Source Control, and then click Workspaces. In the Workspace dialog box, under Workspace, click the workspace, and then click Edit to open the Edit Workspace dialog box.

to be continue…

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s