Free AZ-400 Exam Braindumps
Designing and Implementing Microsoft DevOps Solutions Questions 151–155 (page: 32)

Updated On: 10-Mar-2026

DRAG DROP (Drag and Drop is not supported)

You have a large repository named Repo1 that contains a directory named directory1.

You plan to modify files in directory1.

You need to create a clone of Repo1. The solution must minimize the amount of transferred data.

How should you complete the script? To answer, drag the appropriate values to the correct targets. Each value 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: git clone
Clone a Git repository using git clone
To clone a git repository, use the "git clone" command with the URL of your Git repository.

$ git clone <url>
For example, let's say that you want to clone a public repository from Github, you are going to execute the following command

$ git clone https://github.com/username/project.git

Cloning into 'project'...
remote: Enumerating objects: 813, done.
remote: Total 813 (delta 0), reused 0 (delta 0), pack-reused 813 Receiving objects: 100% (813/813), 3.66 MiB | 5.52 MiB/s, done.
Resolving deltas: 100% (391/391), done.
As you can see, by default, Git is going to clone your Git repository into a folder named by the name of project.

Box 2: git sparse-checkout
Using sparse-checkout with an existing repository
To restrict your working directory to a set of directories, run the following commands:

git sparse-checkout init --cone git sparse-checkout set <dir1> <dir2> ...
If you get stuck, run git sparse-checkout disable to return to a full working directory.

The init subcommand sets the necessary Git config options and fills the sparse-checkout file with patterns that mean "only match files in the root directory".

The set subcommand modifies the sparse-checkout file with patterns to match the files in the given directories. Further, any files that are immediately in a directory that's a parent to a specified directory are also included.


Reference:

https://devconnected.com/how-to-clone-a-git-repository/
https://github.blog/2020-01-17-bring-your-monorepo-down-to-size-with-sparse-checkout/



HOTSPOT (Drag and Drop is not supported)

You have a GitHub repository that contains a workflow named WF1. WF1 is used to build code for an app named App1.

You need to add a build status badge to the README.md file in the repository for App1.

How should you complete the URL for the badge? To answer, select the appropriate options in the answer area.

Note: Each correct selection is worth one point.

Hot Area:

  1. See Explanation section for answer.

Answer(s): A

Explanation:




Box 1: Repository owner

Box 2: Repository name
Adding a workflow status badge
You can display a status badge in your repository to indicate the status of your workflows.

Using the workflow file name
You can build the URL for a workflow status badge using the name of the workflow file:

https://github.com/OWNER/REPOSITORY/actions/workflows/WORKFLOW-FILE/badge.svg To display the workflow status badge in your README.md file, use the Markdown markup for embedding images.

Note: A status badge shows whether a workflow is currently failing or passing. A common place to add a status badge is in the README.md file of your repository, but you can add it to any web page you'd like. By default, badges display the status of your default branch. You can also display the status of a workflow run for a specific branch or event using the branch and event query parameters in the URL.


Reference:

https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/adding-a-workflow-status-badge



DRAG DROP (Drag and Drop is not supported)

You have the repositories shown in the following table.



You need to migrate the contents of the GitHub repository to the Azure Repos repository. The solution must ensure that the Azure Repos repository only contains branches and history from the GitHub repository.

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 clone --bare https://dev.azure.com/contoso/project1.git

Manually import a repo using git CLI
You can also follow these steps to manually import a repo into an Azure DevOps Services repo by replacing TFS with Azure Repos in the following steps.

1. Clone the source repo to a temporary folder on your computer using the bare option, as shown in the following command line example, and then navigate to the repo's folder.
When cloning using the bare option, the folder name includes the .git suffix. In this example, https://github.com/contoso/old-contoso-repo.git is the source repo to be manually imported.

git clone --bare https://github.com/contoso/old-contoso-repo.git cd old-contoso-repo.git

Step 2: cd project1.git

Step 3: git push --mirror https://dev.azure.com/contoso/project1/_git/project1.git

2. Create a target repo using TFS 2017 RTM, and make a note of the clone URL. In this example, https:// dev.azure.com/contoso-ltd/MyFirstProject/_git/new-contoso-repo is the URL for the new target repo.

3. Run the following command to copy the source repo to the target repo.

git push --mirror https://dev.azure.com/contoso-ltd/MyFirstProject/_git/new-co


Reference:

https://learn.microsoft.com/en-us/azure/devops/repos/git/import-git-repository



HOTSPOT (Drag and Drop is not supported)

You use Git for source control. You have an app named App1.

In the main branch, you need to restore the third most recent revision of a file named App.exe.config.

How should you complete the command? To answer, select the appropriate options in the answer area.

Note: Each correct selection is worth one point.

Hot Area:

  1. See Explanation section for answer.

Answer(s): A

Explanation:




Box 1: switch
The following sequence switches to the master branch, reverts the Makefile to two revisions back.

$ git switch master
$ git restore --source master~2 Makefile

Box 2: --source

Incorrect:
--patch
--merge
--staged


Reference:

https://git-scm.com/docs/git-restore



You use Git for source control.

You enable GitHub code scanning.

You raise a pull request from a non-default branch. In the code scanning output, you receive the following error message: "Analysis not found."

You need to ensure that the code scanning completes successfully for the pull request.

Which two actions should you perform? Each correct answer presents part of the solution.

Note: Each correct selection is worth one point.

  1. Add a new workflow for code scanning.
  2. Delete the pull request, and then raise the request again from the default branch.
  3. Add the name of the non-default branch to the on: push specification in the code scanning workflow.
  4. Update the code in the pull request.
  5. Add the name of the default branch to the on: push specification in the code scanning workflow.

Answer(s): D,E

Explanation:

The solution in this situation is to add the name of the base branch to the on:push and on:pull_request specification in the code scanning workflow on that branch and then make a change that updates the open pull request that you want to scan.
Note: Reasons for the "Analysis not found" message
After code scanning has analyzed the code in a pull request, it needs to compare the analysis of the topic branch (the branch you used to create the pull request) with the analysis of the base branch (the branch into which you want to merge the pull request). This allows code scanning to compute which alerts are newly introduced by the pull request, which alerts were already present in the base branch, and whether any existing alerts are fixed by the changes in the pull request. Initially, if you use a pull request to add code scanning to a repository, the base branch has not yet been analyzed, so it's not possible to compute these details. In this case, when you click through from the results check on the pull request you will see the "Analysis not found" message.


Reference:

https://docs.github.com/en/github-ae@latest/code-security/code-scanning/automatically-scanning-your-code- for-vulnerabilities-and-errors/setting-up-code-scanning-for-a-repository



Viewing page 32 of 72
Viewing questions 156 - 160 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!