Master Microsoft DevOps Magic 2025 – Turbocharge Your AZ-400 Skills!

Question: 1 / 400

To enforce a pull request merge strategy that consolidates commit histories into one commit, which option should you select?

Squash merge

To enforce a pull request merge strategy that consolidates commit histories into a single commit, selecting the squash merge option is appropriate.

When you use a squash merge, Git takes all the changes in the pull request and "squashes" them into a single commit that is then added to the target branch. This results in a cleaner project history, as it avoids cluttering the branch with multiple commits that may represent small incremental changes or fixes. Instead, it creates one cohesive commit that summarizes all the changes made in the pull request, making it easier for other team members to read the project's history.

The squash merge strategy is particularly useful in scenarios where it's important to maintain a linear and streamlined commit history. It allows teams to keep their main branch (like main or master) tidy, focusing on high-level changes rather than the detailed evolution of features.

Other choices, such as fast-forward merge and no-fast-forward merge, maintain all individual commit histories, which does not align with the desire to consolidate changes into a single commit. Git fetch is a command used to retrieve the latest changes from a remote repository but does not pertain to the merging process or strategies. Thus, the squash merge is the best choice for consolidating commit histories into one single commit

Get further explanation with Examzify DeepDiveBeta

Fast-forward merge

Git fetch

No-fast-forward merge

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy