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?
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.
The three recommended practices are: A) Delete branches after they are merged to keep the repository clean; C) Use short-lived feature branches that are merged within a day to reduce merge conflicts and promote continuous integration; E) Require build validation on pull requests to the main branch to ensure code quality. B is incorrect because force pushes should be avoided on shared branches as they can rewrite history and disrupt collaboration. D is incorrect because keeping feature branches alive for the entire sprint increases complexity and delays integration.
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
Introduction to DevOps and Azure DevOps
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
Git
Git is a version control system that tracks changes to files so multiple people can work on the same project without overwriting each other's work.
About these practice questions
This AZ-400 question is part of Courseiva's 823-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 by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
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.