Microsoft DevOps Engineer Expert AZ-400 Practice Question

Your Azure Repos Git repository contains an accidentally-committed JSON file that includes production credentials. The file was committed eight months ago, has been modified several times since, and now exists in dozens of historical commits on every developer clone and in the remote origin. You must permanently eradicate all versions of the file from the entire repository history while keeping the rest of the commit data intact and minimizing execution time on a repository of several thousand commits. After the history is rewritten you will force-push the cleaned branch and instruct other developers to reclone.

Which approach meets these requirements with the least effort?

  • Delete the file in the current branch tip and push; enable an Azure DevOps branch policy that rejects commits referencing the file.

  • Run the BFG Repo-Cleaner to delete the file from the entire history, then force-push the rewritten branch.

  • Add the file name to .gitignore, commit, and push to ensure the file is no longer tracked.

  • Use git filter-branch with an index-filter to remove the file and then force-push the rewritten branch.

Microsoft DevOps Engineer Expert AZ-400
Design and implement a source control strategy
Your Score:
Settings & Objectives
Random Mixed
Questions are selected randomly from all chosen topics, with a preference for those you haven’t seen before. You may see several questions from the same objective or domain in a row.
Rotate by Objective
Questions cycle through each objective or domain in turn, helping you avoid long streaks of questions from the same area. You may see some repeat questions, but the distribution will be more balanced across topics.

Check or uncheck an objective to set which questions you will receive.

Bash, the Crucial Exams Chat Bot
AI Bot