Before reading this article, please read the previous articles so that you can understand Azure DevOps. The list of previous articles is provided below.
In my previous article, we learned how to add our code to Azure DevOps Repos. This article will teach us 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 branchesin 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 pullingchanges to share the code with your team.
How to clone the URL to your repo ?
Open your Azure DevOps accountand choose Repos and Files as shown below.
From the upper right corner, click Clone and from the pop-up, select and copy the URL.
Go to your Visual Studioand 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, Ihave selected csharpcorner.visualstudio.com and 'GitDemo' repo.
Next, click "Connect".
Enter the URL that you have copied from the clone section from Azure DevOps paste it into the 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 thatmy 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 afile.
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 inComment number, Message, and Author name.
I 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
If you want to read more about Azure DevOps, the next articles in this series are listed below.