Skip to content
Foxipa
Code Completion 4 Challenges

Complete the Git commands: Git Multi-Pack Index: Indexing Multiple Packfiles

Create a disposable repository with enough commits to produce a set of objects, create multiple packfiles in the lab, and run `git count-objects -v` before creating a MIDX. Run `git multi-pack-index write`, confirm the MIDX exists, and run `git multi-pack-index verify`. Then run `git multi-pack-index repack --batch-size=1m`, followed by `git multi-pack-index expire` and another `git multi-pack-index verify`. Record the number of packfiles before and after the MIDX operations and explain why creating a MIDX is different from merging all objects into one pack. Finish with `git fsck --full` and explain why MIDX verification and object-integrity checking answer different questions. This lesson uses only official Git project documentation for command semantics: `git-multi-pack-index`, `gitformat-pack`, `git-repack`, `git-fsck`, and the Git 2.56.0 command index. No third-party Git documentation is used for command semantics.

Advanced ~6 min read

Challenge 1

Complete the Git command to manage the multi-pack index.

bash Your answer
git  write

Press Ctrl⌘Enter to check your answer

Challenge 2

Complete the Git command to manage the multi-pack index.

bash Your answer
git  verify

Press Ctrl⌘Enter to check your answer

Challenge 3

Complete the Git command to manage the multi-pack index.

bash Your answer
git  repack --batch-size=1m

Press Ctrl⌘Enter to check your answer

Challenge 4

Complete the Git command to manage the multi-pack index.

bash Your answer
git  expire

Press Ctrl⌘Enter to check your answer