Pages

Using Git with VSTS

Below are the steps to get started with VSTS with Git as the version control system.

  1. Firstly you need to signup for Visual Studio Team Services. You can either opt for a free account or a paid account based on your team size, you can check the prices here. While creating your account make sure you choose Git as your version control system, for getting some help on creating your VSTS account check out this page.

  2. After signing up on VSTS open Visual Studio and sign-up on it using the same account you used on VSTS.

  3. After signing up on Visual Studio you would be able to see your VSTS account details in "Team Explorer" window as shown in the image below.

  4. Under the "Clone Repository" section browse to the folder where you want to clone your Git repository and then click Clone.

  5. After the repository is cloned on your system, you need to add projects to it, for that click on "Create a new project or solution" link at the top of team explorer as shown in the below image (marked as 5).

  6. On clicking the link "New Project" window opens up as shown in the above image (marked as 6), now select your project type and write a name for your project and make sure that the project location is set to the directory where you cloned your Git repository in the previous steps. Now leave the other settings as they are and click "OK" and go on to create your project.

  7. Now click on "Changes" in the Team Explorer window (if you don't see the Changes button then click the home button at the top of the Team Explorer window)

  8. On clicking the "Changes" button the current changes in the project will appear as shown in the below image.

  9. Now "Stage" the changes that you want to commit. If you want to commit all the changes then either you can stage all the changes or simply choose Commit All while committing without staging the changes (Note: The term stage is used from VS 2015 update 2 before that they had Included files and Excluded files section).

  10. Now write a comment and Add the workitem to which you want to associate the commit. For adding the work item click on plus(+) symbol next to Related Work Items heading, then enter the ID of the work item that you want to add(you can get the id of the workitem either from the VSTS site or the Workitems view in Visual Studio).

  11. After committing the changes go to home and press "Sync" then the Sync view will open as shown in the below image.

  12. Now first click on "Fetch" to see if there are any incoming Commits, in this case I don't have any so I will simply push the changes on the server so that they could be available to other members of the team. If you have any incoming commits after fetching then first you have to pull them and merge the changes then push your changes.



No comments:

Post a Comment