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
- Sign in to Azure DevOps.
- Select your project or create a new one.
- From the left navigation, click Repos → Files.
- 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
- In Azure DevOps, go to Repos → Pull requests.
- Click New Pull Request.
- Select
feature/welcomeas the source andmainas the target. - Add a title and description, then click Create.
- Review the changes, then click Complete to merge.
Next Steps
- Configure branch policies to enforce code reviews.
- Set up CI/CD pipelines with Azure Pipelines.
- Explore Git hooks and submodules.
- Read the full Azure Repos documentation.