Free AZ-400 Exam Braindumps
Designing and Implementing Microsoft DevOps Solutions Questions 156–160 (page: 33)

Updated On: 10-Mar-2026

DRAG DROP (Drag and Drop is not supported)

You have an Azure Repos repository named repo1.

You delete a branch named features/feature11.

You need to recover the deleted branch.

Which three commands should you run in sequence? To answer, move the appropriate commands from the list of commands to the answer area and arrange them in the correct order.

Select and Place:

  1. See Explanation section for answer.

Answer(s): A

Explanation:




Step 1: git branch features/feature11
You can restore deleted branches.
In your local repo (if hasn't used git fetch after the branches deleted), use git branch -r, it will list all the remote branches. Then you can compare with the branches listed in VSTS, the branches show in local repo but not show in VSTS are the deleted branches.

Step 2: git log
Undo committed local changes
When you commit to your local repository (git commit), Git records your changes. Because you did not push to a remote repository yet, your changes are not public (or shared with other developers). At this point, you can undo your changes.

Undo staged local changes without modifying history
You can revert a commit while retaining the commit history.

This example uses five commits A,B,C,D,E, which were committed in order: A-B-C-D-E. The commit you want to undo is B.

1. Find the commit SHA of the commit you want to revert to. To look through a log of commits, type git log.
(Step 2)

2. Choose an option and undo your changes:

Step 3: git checkout <SHA>
To undo changes on a single file or directory from commit B, but retain them in the staged state:

git checkout <commit-B-SHA> <file> (Step 3)

Note: You can also restore the deleted branches in local repo (if hasn't executed git fetch after the branches deleted) by:

git checkout <a deleted branch in remote>
git push -u origin branchname

Incorrect:
* git stash
To save local changes so you can re-use them later:
git stash

* get restore < >

Note:


Reference:

https://docs.gitlab.com/ee/topics/git/numerous_undo_possibilities_in_git/



HOTSPOT (Drag and Drop is not supported)

You have a project in Azure DevOps named Project1 and an Azure Repos repository named Repo1. Project1 contains a team named Team1.

You need to ensure that all pull requests to the main branch from the feature/* branches are reviewed by the members of Team1 before the pull requests can be merged.

Which two settings should you configure in the Azure DevOps portal? To answer, select the appropriate settings in the answer area.

Note: Each correct answer is worth one point.

Hot Area:

  1. See Explanation section for answer.

Answer(s): A

Explanation:




Box 1: Require a minimum number of reviewers
To configure branch policies in Azure DevOps, go to Project Settings > Repos > Repositories, select your repository, navigate to the Policies tab, then select the main branch to open its policy settings. Enable "Require a minimum number of reviewers" and "Automatically include reviewers" to enforce a review by the specific team before merging from feature/* branches.

Box 2: Automatically include reviewers


Reference:

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



Your company uses a Git repository in Azure Repos to manage the source code of a web application. The default branch is protected from direct updates. Developers work on new features in the topic branches.

Because of the high volume of requested features, it is difficult to follow the history of the changes to the default branch.

You need to enforce a pull request merge strategy. The strategy must meet the following requirements:

Consolidate commit histories.

Merge the changes into a single commit.

Which merge strategy should you use in the branch policy?

  1. no-fast-forward merge
  2. fast-forward merge
  3. git fetch
  4. squash merge

Answer(s): D

Explanation:

To consolidate commit histories and merge changes into a single commit in Azure Repos, you should use the Squash merge strategy.
Why Squash Merge is the Best Strategy
Consolidation: It takes all commits from the topic (source) branch and combines them into a single new commit on the target branch.
Clean History: It removes "noise" from the default branch by discarding individual intermediate commits (e.g., "fixed typo," "trying again") that occurred during development.
Linearity: The resulting history on the default branch remains linear and easy to follow, as each feature appears as exactly one commit.


Reference:

https://learn.microsoft.com/en-us/azure/devops/repos/git/merging-with-squash?view=azure-devops



View Related Case Study

DRAG DROP (Drag and Drop is not supported)

You need to replace the existing DevOps tools to support the planned changes.

What should you use? To answer, drag the appropriate tools to the correct targets. Each tool may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.

Note: Each correct selection is worth one point.

Select and Place:

  1. See Explanation section for answer.

Answer(s): A

Explanation:




Box 1: Azure Boards
Azure Boards can be used to track work with Kanban boards, backlogs, team dashboards, and custom reporting

You can create multiple Trello boards, which are spaces to store tasks (for different work contexts, or even private boards)
You can easily share Trello boards with another person.

Box 2: Azure Pipelines
You can use Bamboo to implement CI/CD (Continuous Integration and Continuous Delivery) for a simple Azure function app using Atlassian Bamboo. Bamboo does continuous delivery of the project from source code to deployment. It has stages including Build, Test and Deploy.

Software teams in every industry are upgrading their continuous delivery pipeline with Bamboo. Easy build import from popular open source tools, user and group import from JIRA, seamless integration with Bitbucket, and native support for Git, Hg, and SVN means you'll be building and deploying like a champ.

Box 3: GitHub repositories
Bitbucket can be used as the Git repository, but you can use any other Git repository (Like TFS Git) for source control of the code.


Reference:

https://www.trustradius.com/compare-products/azure-devops-services-vs-trello https://marketplace.visualstudio.com/items?itemName=ms-vsts.vss-services-bamboo https://www.c-sharpcorner.com/article/cicd-implementation-for-an-azure-function-app-using-atlassian-bamboo- server/



View Related Case Study

You need to the merge the POC branch into the main branch. The solution must meet the technical requirements.

Which command should you run?

  1. git rebase
  2. git merge --squash
  3. git push
  4. git merge --allow-unrelated-histories

Answer(s): B

Explanation:

The commit history of the POC branch must replace the history of the default branch.
Squash merging is a merge option that allows you to condense the Git history of topic branches when you complete a pull request. Instead of each commit on the topic branch being added to the history of the default branch, a squash merge adds all the file changes to a single new commit on the default branch.
Incorrect:
* Rebasing is the process of moving or combining a sequence of commits to a new base commit. Rebasing is most useful and easily visualized in the context of a feature branching workflow. The general process can be visualized as the following:



From a content perspective, rebasing is changing the base of your branch from one commit to another making it appear as if you'd created your branch from a different commit. Internally, Git accomplishes this by creating new commits and applying them to the specified base. It's very important to understand that even though the branch looks the same, it's composed of entirely new commits.
* To combine two separate Git repositories into one, add the repository to merge in as a remote to the repository to merge into. Then, combine their histories by merging while using the --allow-unrelated-histories command line option.


Reference:

https://learn.microsoft.com/en-us/azure/devops/repos/git/merging-with-squash https://jeffkreeftmeijer.com/git-combine/



Viewing page 33 of 72
Viewing questions 161 - 165 out of 398 questions


Post your Comments and Discuss Microsoft AZ-400 exam prep with other Community members:

AI Tutor AI Tutor 👋 I’m here to help!