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
Which merge type condenses all commits of the source branch into a single new commit on the target branch?
- Basic merge (no fast-forward)
- Squash merge
- Rebase and fast-forward
- 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.
Besides basic merge, which merge types can the Azure Repos Limit merge types policy allow?
- Squash merge
- Rebase and fast-forward
- Rebase with merge commit
- Octopus merge
- 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.
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.
