Skip to content
Foxipa
Code Completion 4 Challenges

Complete the Git commands: Git unpack-objects: Expand Pack Archives into Loose Objects

Create two disposable repositories. Put at least two commits in the source repository and use Git plumbing to produce a pack containing the source objects. In a clean receiver repository, run `git unpack-objects --dry-run` first, then unpack the pack. Capture evidence with `git count-objects -v` and `git cat-file -t <object-id>` showing that the receiver now has loose objects. Repeat the unpack to demonstrate that already-present objects are skipped. Finally, explain when `--strict`, `-q`, and `-r` would be appropriate and why `git unpack-objects` is the inverse storage direction of `git pack-objects`.

Advanced ~6 min read

Challenge 1

Complete the Git command to expand packed objects into loose storage.

bash Your answer
git  --dry-run

Press Ctrl⌘Enter to check your answer

Challenge 2

Complete the Git command to expand packed objects into loose storage.

bash Your answer
git 

Press Ctrl⌘Enter to check your answer

Challenge 3

Complete the Git command to expand packed objects into loose storage.

bash Your answer
git  < /path/to/archive.pack

Press Ctrl⌘Enter to check your answer

Challenge 4

Complete the Git command to expand packed objects into loose storage.

bash Your answer
git  < ../incoming.pack

Press Ctrl⌘Enter to check your answer