DEV Community

Isaac Ayodeji Ikusika
Isaac Ayodeji Ikusika

Posted on

Using Git on Visual Studio

Visual Studio is a common tool with dotnet developers. It is an IDE where you can do all your developments without needing any other tool, even database management software. Last week, I saw someone who has Visual Studio use git bash to manage their git repo. I showed them how to use the git tool on the IDE and thought to write something about it.

You can clone an existing repo or start a new project entirely from Visual Studio without having to use any terminal. Everything you need is already in the IDE.

Let us start with cloning an existing repo.

When you open your Visual Studio (version >= 2019), you get this screen.

Let's assume you have a repo you want to clone.

Visual studio screen highlighting cloning an existing repo

Click on "Clone a repository" and you will get this page

clone repository page

Put the link of the repo you want to clone and click on clone

clone repo page pointing to the clone button

Voila, you have successfully cloned a repo.

To create a new repo from a new project, follow these steps:

  1. Create your project

create new project

  1. After your project is created, click on the "Git changes" tab beside the Solution Explorer.

git changes tab

If you cannot find the "Git changes" tab, click the View tab at the top of Visual Studio, you will find "Git changes" there.

git changes location on top of visual studio

  1. When the Git changes tab come up, click on "Create new repository" and you will get this page

create new repo page

  1. Fill the form with everything you want and you are good to go. Subsequent changes can be made in the "Git changes" tab.

NB: You must have your git set up before you can do all these. You may get some prompt to set up your git if you have not.

Oldest comments (0)