AZ-400 Practice Question: Design and implement a source control strategy
Which THREE practices are recommended when implementing a Git branching strategy for a team using Azure Repos?
⚠ Common exam trap
The trap is thinking that force pushes are acceptable for cleaning history or that long-lived branches are fine — both contradict Git best practices for team collaboration.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Delete branches after they are merged.
Option A is correct because deleting branches after they are merged keeps the repository clean and prevents stale, already-integrated branches from accumulating and confusing team members. Option C is correct because short-lived feature branches that are merged within a day reduce merge conflicts, keep continuous integration feedback fast, and align with trunk-based development practices. Option E is correct because requiring build validation on pull requests to the main branch enforces that code compiles and passes tests before merging, protecting the main branch's integrity. Option B is not recommended because force pushes to shared branches rewrite history and can destroy teammates' commits, so they should be blocked via branch policies. Option D is not recommended because keeping feature branches alive for an entire sprint leads to long-lived branches, larger merge conflicts, and delayed integration feedback.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Delete branches after they are merged.
Why this is correct
Deleting feature branches immediately after their merge keeps the repository's branch list focused on active work and prevents stale refs from persisting indefinitely. Stale branches can drift from the latest main, causing confusion about which code is still in use and potentially leading to accidental reverts or conflicting fixes.
- ✗
Allow force pushes to shared branches to clean up history.
Why it's wrong here
Force pushing to shared branches rewrites history that other team members have already based their own work on, which can invalidate their local clones and cause them to lose commits. This is especially dangerous when multiple developers are actively pushing, as it can silently discard work that was never merged, so corrections should use revert or a new commit instead.
- ✓
Use short-lived feature branches that are merged within a day.
Why this is correct
Short-lived feature branches, typically merged within a day, minimize the amount of code that diverges from the mainline, which reduces the likelihood of costly merge conflicts and keeps integration risk low. This practice supports continuous integration by ensuring that changes are validated and merged frequently, before the branch can become stale or diverge significantly.
- ✗
Keep feature branches alive for the entire sprint.
Why it's wrong here
Keeping a feature branch alive for an entire sprint allows it to drift far away from main, so when it is finally merged, the integration effort becomes a large, risky batch instead of a series of small, predictable steps. It also means that the team cannot see or validate the combined behavior of the new feature until late in the cycle, which undermines continuous integration and can lead to last-minute blocking problems.
- ✓
Require build validation on pull requests to the main branch.
Why this is correct
Requiring build validation on pull requests to the main branch ensures that every proposed change compiles and passes automated tests before it can be merged, which prevents broken code from entering the shared mainline. In Azure DevOps, this is enforced via branch policies that automatically trigger a pipeline, and the merge is blocked until the build succeeds, keeping the main branch in a continuously deployable state.
Go deeper
Related to this question
Learn chapter
Managing Build Quality and Package Dependencies
Key term
Branch
A branch is a pointer to a specific commit in a version control system that allows you to work on features or fixes in isolation from the main codebase.
Key term
Continuous integration
Continuous integration is a DevOps practice where developers frequently merge their code changes into a shared repository, with each merge triggering an automated build and test process to catch integration errors early.
About these practice questions
This AZ-400 question is part of Courseiva's 696-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Microsoft exam blueprint
This AZ-400 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-400 exam.