AZ-400 ยท Branching and pull requests
Choosing a branching strategy
Trunk-based development, feature branches, release branches, GitFlow vs GitHub Flow; short-lived branches, feature toggles, matching a strategy to release cadence and team size.
Key points
- Trunk-based development: very short-lived branches into main (hours to a day or two), feature flags hide unfinished work; suits continuous delivery.
- GitHub Flow: one branch per change, PR into always-deployable main.
- Release branches: long-lived, stabilize and patch shipped versions; fixes via cherry-pick.
- GitFlow: long-lived develop branch, scheduled versioned releases.
- Shorter-lived branches, fewer merge conflicts.
Source: https://learn.microsoft.com/en-us/azure/devops/repos/git/git-branching-guidance?view=azure-devops
Practice questions
Which approach keeps branches extremely short-lived and relies on feature flags to hide unfinished work?
- GitFlow
- Trunk-based development
- Long-lived environment branches
- Fork-per-developer model
Show answer
Answer: B. Trunk-based development
Trunk-based development integrates into main continuously and uses flags so incomplete code can merge safely. GitFlow does the opposite: it keeps long-lived develop and release branches.
Which statements describe GitHub Flow?
- The main branch is kept in a deployable state
- Each change is developed on its own branch created from main
- Changes reach main through a reviewed pull request
- A permanent develop branch collects all work before release
- A new long-lived release branch is cut for every supported version
Show answer
Answer: A. The main branch is kept in a deployable state, B. Each change is developed on its own branch created from main, C. Changes reach main through a reviewed pull request
GitHub Flow is deliberately light: main is always deployable, each change gets its own branch, and a pull request is the gate. A permanent develop branch and per-version release branches belong to GitFlow-style models.
Trunk-based development means developers commit straight to main and pull requests are not used.
Show answer
Answer: False
False. Trunk-based teams often still use pull requests, just on very short-lived branches that merge within a day or two. What defines the model is small, frequent integration, not the absence of review.
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.
