In this article I am going to explain How to Use Git Source Control with Visual Studio 2017.
Visual Studio is one of the best integrated development environment (IDE) from Microsoft.
It is used to develop computer programs, as well as websites, web apps, web services and mobile apps using Microsoft technologies like C#, VB, VC++ etc. languages.
Visual Studio uses Microsoft software development platforms such as Windows API, Windows Forms, Windows Presentation Foundation, Windows Store and Microsoft Silverlight.
It can produce both native code and managed code.
Git is a version-control system for tracking changes in computer files and coordinating work on those files among multiple people.
It is primarily used for source-code management in software development, but it can be used to keep track of changes in any set of files.
Visual Studio Comes with pre-installed component to support Git version control system.
If you are developing any app in Visual Studio, you definitely need to track the changes of files during development.
In this tutorial I am going to explain the process to integrate the git with visual studio and how to work on git in Visual Studio.
Use Git Source Control with Visual Studio 2017
- Login to your git account and create a new git repository.
- Copy the URL of git project repository.
- Open visual studio and look for “Add to Source Control” on bottom right corner of Visual Studio.
- Click on that and select Git from menu, Selecting Git will open Team Explorer option.
- From Team Explorer window Click on “Publish Git Repo” Button, and paste the Git Repo URL from Step 2 and Press Publish Button (Shown in image according to order)
- If asked for Credential, enter your git credential in Visual Studio Popup.
- And your code is published to git now, you can verify the published code by visiting your project repo on git.
- Now whenever you make changes in local file, it will be reflected in Changes Section of Team Explorer windows of you Visual Studio.
- To commit those changes to your project repo just, select “Commit All and Push” option and code will be committed to git repository.
Watch this video for reference and live integration of git in Visual Studio.
If you have any doubts or query, just ask it on Ask Question Section.