A Git repository in Azure Repos uses protected master branch and feature work is developed in topic branches. To consolidate commit history and ensure changes are merged as a single commit, which pull request merge strategy should be enforced in the branch policy?
Choose an answer
Tap an option to check your answer.
Correct answer: squash merge.
Why this is the answer
Squash merge is the correct strategy because it consolidates all commits from the topic branch into a single new commit on the master branch. This keeps the master branch history clean and linear, making it easier to review and revert changes if necessary. Fast-forward merge is incorrect because it only works if the master branch has not diverged, and it preserves all individual commits from the topic branch, which is contrary to the goal of consolidating history. Git fetch is a command to download changes, not a merge strategy. No-fast-forward merge (often a regular three-way merge) would also preserve all individual commits from the topic branch, cluttering the master branch history.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed