Designing and Implementing Microsoft DevOps Solutions: Pull Request Strategy for Reducing History Volume

Implementing a Pull Request Strategy for Reducing History Volume

Question

Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.

After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.

Your company uses Azure DevOps to manage the build and release processes for applications.

You use a Git repository for applications source control.

You need to implement a pull request strategy that reduces the history volume in the master branch.

Solution: You implement a pull request strategy that uses squash merges.

Does this meet the goal?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B.

B

Instead use fast-forward merge.

Note:

Squash merge - Complete all pull requests with a squash merge, creating a single commit in the target branch with the changes from the source branch.

No fast-forward merge - This option merges the commit history of the source branch when the pull request closes and creates a merge commit in the target branch.

https://docs.microsoft.com/en-us/azure/devops/repos/git/branch-policies

Yes, implementing a pull request strategy that uses squash merges can meet the goal of reducing the history volume in the master branch.

When a pull request is merged using the "squash and merge" option, all the commits in the pull request are combined into a single commit. This can help reduce the number of commits and the history volume in the master branch, making it easier to review and manage the branch.

In contrast to a regular merge, which preserves the entire commit history of the feature branch, a squash merge creates a new commit that represents the changes introduced by the pull request. This new commit has a single commit message and a clean commit history, making it easier to track changes and identify issues.

However, it's important to note that squash merging can also lead to the loss of detailed information about the individual commits in the feature branch, such as the commit messages, authors, and timestamps. This can make it harder to trace changes and identify the source of issues.

Overall, squash merging can be a useful strategy for reducing history volume in the master branch, but it should be used judiciously and with an understanding of its potential drawbacks.