Cram Sheet250 words

Topic 2.1 — Branching strategies — cram sheet

Topic 2.1 — Branching strategies · cram sheet

Choosing

The deciding question: how many versions must you support in production?

StrategySuits
Trunk-basedCD, strong tests, feature flags
Feature branchMost teams — the default
Release branchMultiple supported versions in the field

Long-lived branches diverge; merge pain grows with time and distance.

Policy vocabulary

PlatformMechanism
Azure ReposBranch policies
GitHubBranch protection rules

Can require: reviewers · linked work items · resolved comments · successful build · external status checks.

Pull request workflow

  • Run machines before humans — never spend review attention on lint.
  • More reviewers ≠ better review (diffusion of responsibility). Prefer code owners.
  • Pick squash or merge commits and enforce it — a mixture is hard to bisect.

Merging restrictions

RestrictionEffect
Require a PRNo direct pushes
Restrict who can pushNamed people/teams/apps
Require status checksBlocked until green
Require up to dateRevalidate against the current target
Include administratorsRules apply to admins too
Block force push / deletionHistory cannot be rewritten

Two traps

  1. Without "require up to date", two individually-green PRs can break main together.
  2. Exempting administrators removes protection exactly when it matters — during an incident.

Ready to study Designing and Implementing Microsoft DevOps Solutions (AZ-400)?

Practice tests, flashcards, and all study notes — free, no sign-up needed.

Start Studying — Free