You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Azure Repos and Azure Artifacts are the source control and package management components of Azure DevOps. Together, they provide a secure, scalable foundation for managing your code and its dependencies throughout the development lifecycle.
Azure Repos provides unlimited free private Git repositories with enterprise-grade features for code collaboration.
# Clone a repository
git clone https://dev.azure.com/myorg/myproject/_git/my-repo
# Create a new branch
git checkout -b feature/add-user-api
# Push and set upstream
git push -u origin feature/add-user-api
| Setting | Description |
|---|---|
| Default branch | The main branch (usually main) |
| Permissions | Who can read, contribute, manage, and force-push |
| Branch policies | Quality gates applied to specific branches |
| Cross-repo policies | Policies that apply to all repositories in a project |
| Commit message validation | Enforce commit message formats |
Branch policies are one of the most important features of Azure Repos. They enforce quality standards before code reaches your main branch.
| Policy | Description |
|---|---|
| Require a minimum number of reviewers | At least N people must approve the PR |
| Check for linked work items | Every PR must reference a work item |
| Check for comment resolution | All review comments must be resolved |
| Limit merge types | Allow only squash, rebase, or basic merge |
| Build validation | One or more CI pipelines must succeed |
| Status checks | External services must report a successful status |
| Automatically include reviewers | Add specific reviewers based on file paths |
| Reset approval on push | Require re-approval when new changes are pushed |
Build validation is perhaps the most critical policy — it ensures no code reaches your main branch without passing CI:
Developer opens PR → CI pipeline runs automatically → Tests pass → Reviewers approve → Merge allowed
If the CI pipeline fails, the PR cannot be completed. This prevents broken builds from reaching the main branch.
You can automatically add reviewers based on the file paths changed:
| Path Pattern | Required Reviewer |
|---|---|
/src/security/* | Security team |
/infra/* | Platform team |
/src/api/payments/* | Payments team lead |
*.sql | DBA team |
A pull request (PR) is the standard way to merge code:
| Strategy | Result | Best For |
|---|---|---|
| Merge commit | Creates a merge commit preserving all branch history | Teams that want full history |
| Squash merge | Combines all branch commits into a single commit | Clean, linear history |
| Rebase | Replays commits on top of the target branch | Linear history without merge commits |
| Semi-linear merge | Rebase + merge commit | Linear history with merge points |
Set a PR to auto-complete when all policies are satisfied:
Azure Repos provides powerful code search across all repositories:
Azure Artifacts provides hosted package feeds for managing your internal and external dependencies.
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.