How To Clone An Existing Git Repo In Azure Repos

In my previous article, we learned how to add our code to Azure DevOps Repos. In this article, we will learn how to clone an existing Repo and work collaboratively with the Team.

In my previous article, we learned how to add our code to Azure DevOps Repos. In this article, we will learn how to clone an existing repository and work collaboratively with the Team.
 
Create a complete local copy of an existing Git repo by cloning it. Cloning a repo downloads all the commits and branches in the repo and sets up a named relationship with the existing repo you cloned. Use this relationship to interact with the existing repo, pushing and pulling changes to share the code with your team.
 
How to clone URL to your repo 
 
Open your Azure DevOps account and choose Repos and Files as shown in the below screen.
 
 
 
From the upper right corner, click Clone and from the pop-up, select and copy the URL.
 
 
Go to your Visual Studio and from the Team Explorer tab, click on "Connect to Project", as shown in the below screen.
 
 
 
It will ask you to log in, so just enter your credentials and log in.

 
 
 
On the "Connect to Project" dialog, select the repo you want to clone from the list. Here, I have selected csharpcorner.visualstudio.com and 'GitDemo' repo.

 
Next, click "Connect".


Enter the URL that you have copied from the clone section from Azure DevOps and paste it on Clone Repository section and click on the Clone button, as shown in the below screen.


It will clone your existing code and project so that you can work with your team remotely.

 

You can see that my project solution is there on the local repo path. 

 

Now, from the Solution Explorer, make changes in files. I have made changes in About.cshtml.


 

Commit your changes by right-clicking on a file.

 

Add the comments related to these changes so that you can track that in Azure Pipelines.

 

Sync your changes on the server by clicking on 'Sync'.

 

Push the master Brach by clicking on Push.



Now, go to your Azure Pipeline and check all the commits. You can see the changes in Comment number, Message, and Author name.


Hope you like this post. In my next article, we will learn what Branch and Merge are in Azure DevOps.

Reference
https://docs.microsoft.com/en-us/vsts/repos/git/clone?view=vsts&tabs=visual-studio