Skip to content
Foxipa
Code Completion 4 Challenges

Complete the Git commands: Git cat-file: Inspect Repository Objects Precisely

Create a disposable repository with at least one commit containing a text file. Record the IDs for the commit, its tree, and the file blob. Use `git cat-file -t` and `-s` to identify each object, `-e` to check the commit, `-p` to inspect the commit and tree, and the typed form to read the commit and blob. Then feed the three object names through `--batch-check`, repeat with a custom `%(objectname) %(objecttype) %(objectsize)` format, and finally run `--batch` for the commit and blob. Finish with `--batch-check --batch-all-objects` and explain why its output is an inventory rather than a reachability report. Do not use a mock Git implementation. Success requires evidence from the actual repository: record the object type and size for the commit, tree, and blob; capture the batch metadata; and explain the difference between object inspection (`cat-file`) and repository integrity/connectivity checking (`fsck`). This lesson uses only official Git project documentation for command semantics, with `git-cat-file`, the Git 2.56.0 command index, and the object model documentation as the primary sources. No third-party Git documentation is used for command semantics.

Advanced ~6 min read

Challenge 1

Complete the Git command to inspect a Git object.

bash Your answer
git  -t

Press Ctrl⌘Enter to check your answer

Challenge 2

Complete the Git command to inspect a Git object.

bash Your answer
git  -s

Press Ctrl⌘Enter to check your answer

Challenge 3

Complete the Git command to inspect a Git object.

bash Your answer
git  -e

Press Ctrl⌘Enter to check your answer

Challenge 4

Complete the Git command to inspect a Git object.

bash Your answer
git  -p

Press Ctrl⌘Enter to check your answer