AZ-401 study notes · 10–15% of the exam

Design and implement a source control strategy

First draft for review. Check details against Microsoft Learn before relying on them.

What this area covers

Branching strategies, pull request rules, repository settings and migrating repositories from Azure DevOps to GitHub.

Branching strategies

  • Trunk-based: short-lived branches merged to main often. Suits continuous delivery.
  • Feature branches and GitHub flow: branch, open a PR, review, merge to main.
  • Git flow: develop, release and hotfix branches. Heavier, suits scheduled releases.
  • Release branches let you support several versions.
  • Git worktree checks out several branches at once in separate folders, which is useful when agents work in parallel.

Pull request rules

  • Branch policies (Azure Repos) and branch protection rules or rulesets (GitHub) can require reviews, passing builds, linked work items and resolved comments.
  • Restrict merge types, for example squash only.
  • For GitHub Copilot, the coding agent works on its own branches and opens PRs. A person must approve workflow runs on its pushes, and normal protection rules still apply before merge.

Repository management

  • Set permissions per team or group. Use tags to mark releases.
  • Show code quality and coverage on PRs, and link to work items or issues.
  • Git hooks such as pre-commit run checks locally before a commit.
  • Migrate from Azure DevOps to GitHub with GitHub Enterprise Importer, which keeps history.
  • Remove sensitive data from history with git filter-repo, then rotate any leaked secret. Recover lost commits with git reflog.