AZ-400 Practice Question: Design and implement a source control strategy
Your organization uses Azure Repos and has multiple Git repositories that share common code. You want to enable code reuse across these repositories without duplicating code. Which strategy should you use?
⚠ Common exam trap
It's easy for candidates to confuse package management (NuGet, Azure Artifacts) with source control strategies, leading candidates to choose options that distribute compiled artifacts rather than shared source code.
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
✓
Reference the shared repository as a Git submodule
Git submodules allow you to include a specific commit of a shared repository as a subdirectory within multiple parent repositories, enabling code reuse without duplication. When the shared code is updated, you can pull the latest commit into each parent repository, maintaining a clear link between the parent and the shared codebase. This is the native Git mechanism for referencing external repositories while preserving version control history.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use Git subtrees to merge the shared code into each repository
Why it's wrong here
Git subtrees physically copy the shared code into each repository's history, causing duplication and requiring manual or automated reconciliation to pull updates; they do not preserve a single source of truth for the shared code, making it unsuitable for maintaining synchronized shared source across multiple repos.
- ✗
Publish the shared code as a NuGet package
Why it's wrong here
NuGet packages are compiled binary artifacts, not source code, so publishing shared code this way would require a build/package step and would prevent consumers from directly viewing or modifying the source; it also introduces versioning and dependency management overhead that is orthogonal to Git-based source sharing.
- ✓
Reference the shared repository as a Git submodule
Why this is correct
A Git submodule references a specific commit from the shared repository, allowing the parent repository to track that exact version without copying the code; this keeps a single canonical source, enables atomic checkout, and lets you update the shared code deliberately by moving the submodule pointer—making it the correct choice for sharing source across multiple Git repos.
- ✗
Add the shared repository as an upstream source in Azure Artifacts
Why it's wrong here
Azure Artifacts is a package management feed designed for distributing package types like NuGet, npm, and Maven, not for hosting Git repositories; upstream sources in Azure Artifacts pull external package versions into a feed, so they cannot serve as a Git remote or provide source-level integration for your repositories.
Go deeper
Related to this question
Learn chapter
Introduction to DevOps and Azure DevOps
Key term
Azure Repos
Azure Repos is a set of version control tools that allow teams to manage their source code, track changes, and collaborate on software projects using Git or Team Foundation Version Control (TFVC) within the Microsoft Azure ecosystem.
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.