Bitzu

AZ-400 ยท Branching and pull requests

Merge types and merge restrictions

Merge commit, squash, rebase and semi-linear merges, allowed merge types per policy, restricting force push and deletion, bypass permissions, merge queue.

Key points

  • Limit merge types policy restricts Azure Repos styles:
  • Basic merge: no fast-forward, nonlinear. Squash merge: one new commit, linear.
  • Rebase and fast-forward: replays commits, linear. Rebase with merge commit: semi-linear.
  • GitHub Require linear history blocks merge commits.
  • Protected branches block force push and deletion by default; bypass permissions skip rules.
  • Merge queue: tests each PR with the latest target plus PRs queued ahead.

Source: https://learn.microsoft.com/en-us/azure/devops/repos/git/branch-policies?view=azure-devops

Practice questions

Single choice

Which merge type condenses all commits of the source branch into a single new commit on the target branch?

  1. Basic merge (no fast-forward)
  2. Squash merge
  3. Rebase and fast-forward
  4. Rebase with merge commit
Show answer

Answer: B. Squash merge

Squash merge produces one commit with the combined changes and a linear history. Basic merge keeps every commit plus a merge commit, and rebase replays the commits individually.

Select all that apply

Besides basic merge, which merge types can the Azure Repos Limit merge types policy allow?

  1. Squash merge
  2. Rebase and fast-forward
  3. Rebase with merge commit
  4. Octopus merge
  5. Cherry-pick merge
Show answer

Answer: A. Squash merge, B. Rebase and fast-forward, C. Rebase with merge commit

The policy exposes squash, rebase and fast-forward, and rebase with merge commit next to basic merge. Octopus merge and cherry-pick merge are not options in this policy.

True or false

Enabling the Require linear history protection in GitHub blocks squash merges.

Show answer

Answer: False

False. It blocks merge commits, so PRs must be merged by squash or rebase; at least one of those methods must be enabled for the repository.

Practice 8 questions on this topic in Bitzu

Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.

Download on the App StoreGet it on Google Play

More AZ-400 topics in this module