How to Clone a Git Repository in Visual Studio

In my trainings, junior developers often ask me how to clone a Git repository in Visual Studio. Perhaps it may be very simple for senior developers, however for the developers who struggle to get it right the procedure is rovided here.

Step 1

Find the URL of the remote Git repository. For a GitHub repository the URL can be found as shown in the image below. Copy the URL from there.


Step 2

Launch Visual Studio and from the View select Team Explorer. In the Team Explorer window select Clone.

Team Explorer window

On clicking Clone, you will get an option to provide the URL of the Git repo and choose the folder in which the repository will be cloned. In the URL section paste the remote repository URL as shown in the following image:


As the last step click on the Clone and the remote Git repository will be cloned in the Visual Studio in the given folder. If everything goes right you will get a success message as shown below.

Git repository

I hope it helps. Thanks and Happy Coding.