Microsoft DevOps Engineer Expert AZ-400 Practice Question
A security scan shows that an Azure Repos Git repository contains a private SSH key file named id_rsa that was committed three months ago and has since been merged into several long-lived branches and tags. You must permanently remove every copy of the file from the entire repository history, reduce the repository's size, and enable other contributors to continue working without re-introducing the file.
Which approach meets these requirements?
Run git filter-repo --path id_rsa --invert-paths in a fresh clone, force-push the rewritten branches and tags to Azure Repos, then instruct all contributors to re-clone or hard-reset to the updated history.
Delete id_rsa in the web editor of the main branch and run git gc on the remote repository.
Revert the commit that added id_rsa on every branch and push the new revert commits.
Enable a branch policy that blocks binary files, commit a change that removes id_rsa, and push without rewriting history.
Rewriting history is required because simply deleting the file in a new commit or reverting the original commit leaves the sensitive data in earlier snapshots. The recommended tool for large-scale history rewrites is git filter-repo (or BFG Repo-Cleaner). Running git filter-repo --path id_rsa --invert-paths excises every version of id_rsa while preserving the rest of the repository. A forced push updates all remote branches and tags to the cleaned history. After this rewrite, collaborators must either re-clone or hard-reset to the new refs; otherwise their next push will attempt to re-introduce the orphaned objects. Garbage collection on the server will later remove the dangling blobs.
Deleting the file in a normal commit, reverting a single commit, or enabling a branch policy do not purge the key from previous commits, so they fail to meet the requirement to remove the data from all history.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does `git filter-repo --path id_rsa --invert-paths` do?
Open an interactive chat with Bash
What is the significance of running garbage collection (`git gc`) after rewriting history?
Open an interactive chat with Bash
Why must collaborators re-clone or hard-reset their local repositories after a history rewrite?
Open an interactive chat with Bash
Microsoft DevOps Engineer Expert AZ-400
Design and implement a source control strategy
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .