Today I will focus the feature the version control stuff in TFS 2012, Whether you are building software at a large company or with a few friends in your garage, on a good day you are able to focus all your energy on researching, designing, coding, testing, and building your app. You probably give little thought to your version control system. Team Foundation version control is designed to simply and quietly as possible do just what you need it to do, which in most cases is to take good care of your code.
Let’s go through setup a Dev machine and the using the super duper version control shipped with TFS 2012 🙂
Before we start working in version control, we must:
- Install Team Foundation Server. How?
- Install Visual Studio on your dev box. How?
- Create a team project (if you don’t already have one). How?
Now lets create a workspace, below is a quick and simple steps to create a new workspace:
- In Windows, create the folder that will contain your code (including the solution, code projects, and the source code files). For example, this would be a good location for your folder: c:\code\SiteApp\.
- In Visual Studio, in Team Explorer:
- If you are not already connected to the team project that you want to work in, then connect to the team project.
- Choose Home, and then choose Source Control Explorer.
- In Source Control Explorer, navigate to your team project. Choose Not mapped.
- Use the Map dialog box to map the root folder of your team project to the appropriate local folder. For example, you could map $/SiteApp to c:\code\siteapp.
- The system prompts you to download the files in the folder you just mapped.Choose Yes.
After the files are downloaded, you are ready go get busy coding, unless you are beginning work in a new team project. In this case, before you get started, read on for a simple tip about folder structure.
Now we are ready to develop some code;
if you are starting to work in a new team project, then take this simple step when you set up your version control folder structure, and you’ll be ready when your team grows large enough for you to need branches to manage your work.
Put all your code in a parent called Main (for example: $/SiteApp/Main/).
To develop your code in the “Main” parent folder
- On the menu bar choose View, Other Windows, Source Control Explorer.
- In Source Control Explorer, select your team project in the left pane.
- On the menu bar choose File, Source Control, New Folder.Type Main and choose the Enter key.
- Open the shortcut menu of the Main folder and choose Check in.
- The Check-in Confirmation dialog box appears.
- Select Don’t prompt again and choose Yes.
- Your changeset is checked in.
- Get busy building your app. Make sure to put your code (including solutions, code projects, source files) in the Main folder that you just created.
Now that your workspace is set up, you are almost ready to begin developing code and writing tests!