AZ-400 Practice Question: Design and implement a source control strategy
Your team uses GitHub Flow. A developer pushes a feature branch to origin and creates a pull request to main. After review and approval, the pull request is merged. Which branch should the developer delete after the merge to maintain a clean repository?
⚠ Common exam trap
A common mix-up: candidates think keeping feature branches is harmless or that deleting main is acceptable for cleanup, but GitHub Flow explicitly requires deleting feature branches after merge to maintain a clean, linear history and avoid repository clutter.
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 the feature branch
In GitHub Flow, feature branches are temporary and should be deleted after their pull request is merged into main. Deleting the feature branch keeps the repository clean by removing stale branches that are no longer needed, reducing clutter and preventing confusion. This practice aligns with the principle of short-lived branches in trunk-based development workflows.
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 the feature branch
Why this is correct
Delete the feature branch. In GitHub Flow, feature branches are ephemeral and should be deleted after their pull request is merged, because the merge already integrates all commits into main; leaving the branch creates stale references and confusion for future work.
- ✗
Keep both branches indefinitely
Why it's wrong here
Keep both branches indefinitely. This clutters the repository with stale branches that no longer receive updates, making it harder to identify active work and increasing the risk of accidentally basing new changes on outdated code.
- ✗
Delete the main branch
Why it's wrong here
Deleting the main branch in GitHub Flow is a catastrophic mistake because main is the permanent default branch that stores the entire authoritative history of the repository, including every merged feature commit. It also hosts branch protection rules, required status checks, and CI/CD triggers, all of which would be silently wiped out, breaking the team's delivery pipeline and orphaned open pull requests. Unlike a feature branch, which is disposable after its commits are integrated, main is the shared baseline that every collaborator clones, merges into, and builds from; removing it forces an emergency recovery from a reflog or a fork and provides no cleanup benefit whatsoever.
- ✗
Delete the remote main branch and recreate it
Why it's wrong here
Delete the remote main branch and recreate it. This is unnecessary and disruptive: it rewrites the default branch, forces all collaborators to re-sync, loses pull request history and protection rules, and introduces risk of data loss without solving the branch cleanup need.
Go deeper
Related to this question
Learn chapter
Final Review and Exam Preparation
Key term
Feature
A feature is a distinct unit of functionality that delivers value to the user, often managed and tracked throughout the software development lifecycle.
Key term
Repository
A repository is a central storage location where software packages, code, or configuration files are kept, managed, and distributed for use by IT systems.
About these practice questions
Courseiva writes every AZ-400 question from scratch — 823 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or 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.