March 21, 2017
How To: Git Using VSTS
Just like TFVC (Team Foundation Version Control), Git is another Source Version Control and it’s becoming very popular. VSTS (Visual Studio Team Services) supports both TFVC and Git. Let’s assume that you have no project or Repository and wants to begin with Git on VSTS.
Step 1: Create a New Project
Login to your VSTS account, click on New Project
And fill the information.
Click “Create” and you will notice that Project will be Created as shown below.
Step 2: Clone it in IDE
Click “Clone in Visual Studio”. New Visual Studio IDE will start a dialog like shown below will popup.
Provide the Repository path and click on “Clone”.
Switch to Team explorer and Click on “Create a new project or solution”
When prompted choose the project type. After Project is added successfully you will notice that project is added in Solution Explorer and shows (+) in front of various items and also Team Explorer’s Changes tab shows all the items listed as newly being added.
Step 3: Commit Changes and Publish
After project being added into Solution Explorer it’s considered as a change to the blank repository/project you created. Hence, this change needs to be added to remote Master branch.
In Team Explorer Changes, add a comment for check-in and click on “Commit All”
Click “Commit All” and from the next Synchronization Tab, click “Publish”
Now your Git Repository in VSTS should be updated with the code you have pushed-in to it. Refresh your VSTS page and you should be able to see your project code added.