How to create new workspace in TFS, how to use them and how to check out projects from TFS?
If you have TFS (Team Foundation Server) installed, Open Visual Studio 2012 and go to
- File > Source Control>Advance>Workspaces. A dialog popups. Click add workspace, type in name of the new space
- Select the workspace and click edit button. Set the local path as well are remote path.Best practice is, Remote path should be the root folder where all projects are sitting. Local path should be empty folder preferably sitting in the root folder such as c:\Projects\
- The local folder has been mapped. Now TFS will ask you to check out the project (a dialog box will popup). Select no at this point. Selecting yes will force to check out everything in the root folder which you may not want.
- In Visual Studio 2012, go to Team Foundation Server, click on home button then “Explore Source Code”. Now select the folder you want to check out and select get latest. You can select a folder embedded in the root folder. That will check out the folder you selected as well as its complete path. This way your local copy of the repository has the same exact path as on the Server.
Workspaces is a wonder way to fix issues in builds. For example you have a workspace which you are working in. Suppose someone checked in the code that broke the build. Now you can create a second workspace as guided above and check out the same project. Open the new project in a new Visual Studio. You will spot the bug right away without breaking your existing code (which might work fine).