Challenge - 5 Problems
Packfiles and Compression Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
Understanding git packfile creation
What is the output of the command
git gc --aggressive --prune=now in a repository with many loose objects?Attempts:
2 left
💡 Hint
Think about what aggressive garbage collection does in Git.
✗ Incorrect
The git gc --aggressive --prune=now command compresses loose objects into packfiles and immediately removes unreachable objects, cleaning up the repository efficiently.
🧠 Conceptual
intermediate1:30remaining
Purpose of delta compression in Git packfiles
Why does Git use delta compression inside packfiles?
Attempts:
2 left
💡 Hint
Think about how storing differences can save space.
✗ Incorrect
Delta compression stores only the changes between similar objects, which reduces the size of packfiles and saves disk space.
❓ Troubleshoot
advanced2:00remaining
Diagnosing corrupted packfile error
You run
git fsck and get an error about a corrupted packfile. Which command helps you safely rebuild packfiles to fix this?Attempts:
2 left
💡 Hint
Look for a command that repacks objects.
✗ Incorrect
git repack rebuilds packfiles and can fix corruption by repacking all objects with specified options.
✅ Best Practice
advanced1:30remaining
Optimizing packfile compression for large repositories
Which approach is best to optimize packfile compression for a large repository with many similar files?
Attempts:
2 left
💡 Hint
Aggressive garbage collection improves compression but takes more time.
✗ Incorrect
Running git gc --aggressive compresses objects more thoroughly, which is ideal for large repositories with many similar files.
🔀 Workflow
expert2:30remaining
Sequence to safely reduce repository size using packfiles
What is the correct sequence of commands to safely reduce a Git repository size by compressing objects and removing unreachable data?
Attempts:
2 left
💡 Hint
Think about garbage collection first, then repacking, pruning, and finally checking.
✗ Incorrect
First run git gc to clean and compress, then git repack -a -d to repack all objects, followed by git prune to remove unreachable objects, and finally git fsck to verify integrity.