How to clone Azure Repos?

How to clone Azure Repos?

How to clone Azure Repos?

Hello Everyone

Welcome to CloudAffaire and this is Debjeet.

You can clone an Azure repo using HTTPS (With password or personal access token) or SSH endpoints. In this blog post, we will discuss different ways of cloning an Azure repository in your local system.

How to clone Azure Repos?

Prerequisites:

Clone Azure Repo using HTTPS with Password:

Step 1: Login to your Azure DevOps account using below link

https://dev.azure.com/your_organization_name

Step 2: Navigate to Azure repo under your project.

Azure DevOps Organization => Project => Repos => Files

Select the HTTPS endpoint and click ‘Generate Git Credentials”.

Clone Azure Repo using HTTPS with Password

Step 3: Copy the generated credentials and store it in a safe place. Also copy the HTTPS clone URL.

Clone Azure Repo using HTTPS with Password

Step 4: Open your favorite terminal and type below git command to clone the repository.

If you refresh your Azure repo page, you will be able to see the file now that we just pushed.

Clone Azure Repo using HTTPS with Password

Clone Azure Repo using HTTPS with Personal Access Token:

Step 1: Generate a personal access token in your Azure DevOps account.

https://cloudaffaire.com/how-to-create-a-personal-access-token-pats-in-azure-devops/

Step 2: Clone Azure Repo using Personal Access Token (PAT).

Clone Azure Repo using SSH:

Step 1: Generate SSH keys for Azure Repos using ssh-keygen.

Step 2: Copy the content of the public key

Step 3: Login to your Azure DevOps account using below link

https://dev.azure.com/your_organization_name

Step 4: Click on the user setting icon on the top right corner and then click on “SSH Public Key”.

Clone Azure Repo using SSH

Step 5: Click on the “New Key” button to add the public ssh key.

Clone Azure Repo using SSH

Step 6: Give a name to the public ssh key and copy the content of your public ssh key in the “Public Key Data” section (Copied in step 2) and click “Add”.

Clone Azure Repo using SSH

Step 7: Switch back to the terminal and execute below command to clone your Azure repo using SSH key.

Note: You can get the SSH clone URL from your Azure repo inside your project.

Clone Azure Repo using SSH

Hope you have enjoyed this article. To know more about Azure DevOps, please refer below official documentation

https://docs.microsoft.com/en-us/azure/devops/?view=azure-devops

Leave a Reply

Close Menu