Microsoft DevOps Engineer Expert AZ-400 Practice Question
An Azure DevOps team has a 4 GB Azure Repos Git repository that contains two years of high-resolution *.png and *.jpg files committed as regular blobs. To shrink clone and fetch sizes, the team decides to move these graphics to Git Large File Storage (LFS). They have installed the Git LFS client locally and added the patterns *.png and *.jpg to the project's .gitattributes file. What additional step must they perform so that all previous commits are rewritten to replace the full-size images with LFS pointer files before they push the updated history to the remote repository?
Execute git lfs track --convert-history to retroactively track the image files.
Perform git gc --aggressive on the local repository to prune large objects and recreate them as LFS pointers.
Run git lfs migrate import --include=".png,.jpg" --everything and then force-push the rewritten history.
Commit and push the updated .gitattributes file; the server automatically converts existing blobs to LFS objects on the next push.
Adding patterns to .gitattributes only affects new commits. To retroactively move existing objects into Git LFS you must rewrite the repository history. The git lfs migrate import command scans the specified revisions, replaces matching blobs with LFS pointer files, and updates the commits accordingly. Options such as git lfs track or git gc do not modify past commits, and merely making a new commit after editing .gitattributes leaves historical blobs untouched.
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 is Git LFS and how does it work?
Open an interactive chat with Bash
What does the git lfs migrate import command do?
Open an interactive chat with Bash
Why do you need to force-push after migrating to Git LFS?
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 $11.99
$11.99/mo
Billed monthly, Cancel any time.
$19.99 after promotion ends
3 Month Pass
$44.99 $26.99
$8.99/mo
One time purchase of $26.99, Does not auto-renew.
$44.99 after promotion ends
Save $18!
MOST POPULAR
Annual Pass
$119.99 $71.99
$5.99/mo
One time purchase of $71.99, Does not auto-renew.
$119.99 after promotion ends
Save $48!
BEST DEAL
Lifetime Pass
$189.99 $113.99
One time purchase, Good for life.
Save $76!
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .