IntroductionWhen a team of developers grows larger and larger it is a best practice to introduce Version Control in the project. Version control has some advantages :
- A controlled way of working together on the same code.
- Storing versions in order to understand the differences and to understand what happened during development of the code.
- To see how much work a subproject/sprint was during evaluation.
- As a backup for the code (in a former blogpost I described a way to automatically backup the project)
- Creating multiple branches in the code in order to distinguish subprojects, Development and production code (eg. for hotfixes).
In this blogpost the following steps are described:
- Step 1 : Create a sample project in Visual Studio
- Step 2 : Create a Team Project
- Step 3 : Connect to the Team project environment in Visual Studio.
- Step 4: Setup a workspace on your local system.
- Step 5: Add the project to Source control / Team project
- Step 6: Do some changes in the local VS project.
- Step 7: Check the online Team foundation Server environment.
Step 1: Create a sample projectFirst, lets make a solution with some examples in a Visual Studio project. The solution I've created for this blogpost includes a SQLProject, a SSISProject and a Tabular Project.
Step 2: Create a Team ProjectThe next step is to go to the VisualStudio.com and to create a new team project with New team project.
Step 3: Connect to the Team Project environmentThe next step is to find the Team Explorer in Visual Studio, and there are several options to choose from. In this case, select the Connect link of the Visual Studio Team Services.
The window "Connect to Team Foundation Server" appears and now the url is needed of name of the Visual Studio Team services account. Select the option "Servers".
Press the Servers button and Add a new server. Login in with your account and press sign in
The following window appears
Step 4: Setup a workspaceIn Visual Studio it is needed that there is a local workspace to work with. This is a local copy of the code of the central repository. Click on Configure Workspace.
Next step is to Map & Get the local workspace with the central repository
When the Map&Get is successfully a message is presented : "The workspace was mapped successfully"
Step 5: Add the project to Source control / Team ProjectsNow the workspace and the central repository is connected and now it 's time to add the local solution to the Visual Studio Team Services by clicking on Add Solution to Source Control.
Now, it is important to set the location in Visual Studio Team Services. Press OK when this is done
Now the projects are marked with a + sign indicating that the files are ready to check in Visual Studio Team Services.
Right click on the solution and click on Check in to upload the code the repository.
Add some comment, check if everything is ok and press Check in
A confirmation window appears and click on Yes.
A confirmation is shown to the usr that the code is successfully checked in
Step 6: Do some changes in the local VS projectNow, let's see what happens when something changes in the code. In the initial situation the code is locked and check in.
For instance let's add a SSIS package to the SSIS project.
Two packages were added to the local Workspace. You can see this below Package1 and Package2.
Because the SSIS Packages are added to the project(file), the project (file) is also marked as changed and therefore this should be uploaded to the repository too.
Select the Project and click on the Source Control option.
An overview is shown of the new and changed packages. Click on Check in.