Challenge - 5 Problems
Git Garbage Collector Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
What does
git gc do?Which of the following best describes the purpose of the
git gc command?Attempts:
2 left
💡 Hint
Think about how Git manages storage and what cleanup might mean.
✗ Incorrect
The git gc command stands for garbage collection. It removes unnecessary files and compresses objects to optimize the repository's storage.
❓ query_result
intermediate2:00remaining
Output of
git gc --dry-runWhat is the expected output when running
git gc --dry-run in a repository?Attempts:
2 left
💡 Hint
The
--dry-run option usually means no changes are made.✗ Incorrect
The --dry-run option simulates the garbage collection process and lists what would be done without changing anything.
📝 Syntax
advanced2:00remaining
Identify the correct
git gc command to aggressively optimizeWhich command runs
git gc with aggressive optimization to compress objects more thoroughly?Attempts:
2 left
💡 Hint
Look for the official flag that increases compression effort.
✗ Incorrect
The --aggressive flag tells git gc to spend more time compressing objects for better optimization.
🔧 Debug
advanced2:00remaining
Why does
git gc fail with 'unable to create temporary file' error?You run
git gc and get the error: unable to create temporary file. What is the most likely cause?Attempts:
2 left
💡 Hint
Temporary files need space and permission to be created.
✗ Incorrect
This error usually means Git cannot write temporary files because the disk is full or permissions are missing.
❓ optimization
expert3:00remaining
How to automate
git gc for large repositories?For a large repository with many objects, which approach best automates running
git gc without impacting developer workflow?Attempts:
2 left
💡 Hint
Think about balancing optimization and developer experience.
✗ Incorrect
Using git gc --auto scheduled during low activity times automates cleanup without slowing down developers.