[2022] How to clone Azure Git Repos (quickly) using Visual Studio

Henrique Cardamone
4 min readDec 21, 2022

--

Wy using Visual Studio to Clone your Azure Repos?

Before I started using Azure DevOps I was always using the git command lines for everything that I needed, but, when I began “spending” a lot of hours coding or creating scripts or whatever related to “coding”, I started figuring out that I can use my time more effectively, so I founded some “alternatives” to using unnecessary command lines. Then I wrote this article to share my thoughts.

Clone an existing Git repo

Azure DevOps Services | Azure DevOps Server 2022 — Azure DevOps Server 2019 | TFS 2018

Visual Studio 2019 | Visual Studio 2022

You can create a local copy of a remote Git repo by cloning it into a local folder on my computer. Cloning remote repo downloads all commits on all branches of the repo unless you use the --single-branch clone option. Cloning links each branch in your new local repo with the corresponding branch in the remote repo. That way, the related remote branch is updated when you push to share your local branch changes with your team. Similarly, when you pull to update your local branch with changes made by your team, updates from the corresponding remote branch are retrieved. The remote repo can be an Azure Repos Git repo, a GitHub repo, or another hosted Git repo. To get more details, check the Azure Repos Git tutorial.

Note: When you’re signed into an Azure DevOps project, the IDE Visual Studio supports searching for and cloning project repos without needing to know the user and password.

1. Click on this icon

2. Then click on ‘Turn on Cloud Changes…’

3. After that the ‘Sign in with Microsoft’ will be displayed

4. Then just click on the “Open Visual Studio Code” pop-up to put your user and password that you are using on Azure DevOps

Clone the Azure Repo

  1. From your web browser, open the team project for your Azure DevOps organization, and then choose Repos > Files to open the Files view.

2. In the Files view, choose Clone to launch the Clone Repository popup.

3. From your web browser, open the team project for your Azure DevOps organization and then choose Repos > Files to open the Files view.

4. In the Files view, choose Clone to launch the Clone Repository popup and click on Clone in VS Code options.

5. Then the pop-ups to open VS Code will be displayed, just allow it to set the path and clone/copy the project repo locally.

So finally just select the repository destination and your clone/copy will be able locally.

Conclusion

We have learned how to clone Azure Git Repos using Visual Studio in a simple step-by-step manner. Feel free for any questions. See you there.

--

--