Skip to content
Foxipa
Code Completion 4 Challenges

Complete the Git commands: Git Object Storage: Count, Repack, and Verify Packfiles

Create a disposable repository with at least two commits. Run `git count-objects -v -H` and record the loose-object count. Run `git repack -ad`, run the count again, and identify the changes in `count`, `in-pack`, `packs`, and `size-pack`. Locate the resulting `.idx` file under `.git/objects/pack/` and verify it with `git verify-pack`, then repeat with `-s` and `-v`. Finally run `git fsck --full` and explain why successful pack verification and successful object-integrity checking answer different questions. This lesson uses only official Git project documentation for command semantics: `git-count-objects`, `git-repack`, `git-verify-pack`, `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 use the `git count-objects` operation.

bash Your answer
git  -v -H

Press Ctrl⌘Enter to check your answer

Challenge 2

Complete the Git command to use the `git count-objects` operation.

bash Your answer
git 

Press Ctrl⌘Enter to check your answer

Challenge 3

Complete the Git command to use the `git count-objects` operation.

bash Your answer
git  -v

Press Ctrl⌘Enter to check your answer

Challenge 4

Complete the Git command to repack repository objects.

bash Your answer
git  -ad

Press Ctrl⌘Enter to check your answer