Azure Repos – Get Started

Overview

Azure Repos provides unlimited, cloud-hosted private Git repositories. This tutorial walks you through creating a repo, cloning it locally, and pushing your first code changes.

Prerequisites

Create a Repository

  1. Sign in to Azure DevOps.
  2. Select your project or create a new one.
  3. From the left navigation, click Repos → Files.
  4. Click New Repository, give it a name (e.g., hello-world), and click Create.

Clone the Repository

Copy the clone URL from the Clone button in Azure Repos and run:

git clone https://dev.azure.com/YourOrg/YourProject/_git/hello-world

Push Your First Commit

Navigate into the repo folder, create a file, commit, and push:

cd hello-world
echo "# Hello Azure Repos" > README.md
git add README.md
git commit -m "Add initial README"
git push origin main

Branching Basics

Create a new feature branch, make changes, and push it:

git checkout -b feature/welcome
echo "Welcome to Azure Repos!" >> README.md
git add README.md
git commit -m "Add welcome message"
git push -u origin feature/welcome

Create a Pull Request

  1. In Azure DevOps, go to Repos → Pull requests.
  2. Click New Pull Request.
  3. Select feature/welcome as the source and main as the target.
  4. Add a title and description, then click Create.
  5. Review the changes, then click Complete to merge.

Next Steps