Skip to main content

Cloning a Repository

When you have a Git repository on Azure DevOps (or anywhere else), it exists as a remote repository. You can clone your repository to create a local copy on your computer and sync between the two locations.

To clone a repository in Azure DevOps, for the first time, use the following steps:

Generate PAT

Azure DevOps requires that you authenticate when cloning a repository using either a Personal Access Token (PAT) or SSH. The easiest method is to use a PAT, but docs on using SSH can be found here.

  1. Navigate to the Azure DevOps project
    1. ex: https://dev.azure.com/rizing-devops/rizing
  2. Click the "Repos" menu item from the left side menu
    1. Select "Files"
  3. In the last breadcrumb in the top bar, select the desired Git repository
  4. Click the "Clone" button in the upper right corner of the files panel
    Screenshot 1
  5. Click the "Generate Git Credentials" button
    Screenshot 2
  6. Save the "Password" (known as a Personal Access Token or "PAT") to your password manager
    alt text
  7. Copy the Git HTTPS URL value to the clipboard
    alt text
  8. Clone the repository

Clone Repository

tip

Ensure you have Git installed

Option 1) Clone using VS Code

  1. Click the "Clone in VS Code" button and follow the prompts

Option 2) Clone using command line

  1. Open a Powershell or command line terminal
  2. Navigate to the location where you want to clone the repository
    1. ex: cd C:/Workspace (Windows) or cd ~/Workspace (MacOS)
  3. Enter command to clone repo
    git clone https://YOUR_REPOSITORY_URL
    # ex: git clone https://rizing-devops@dev.azure.com/rizing-devops/rizing/_git/monorepo
  4. The repository is now available

Resources