Skip to content
Foxipa
Code Completion 4 Challenges

Complete the Git commands: Git show-index: Inspect Pack Indexes

Create a disposable repository containing at least two commits. Generate or obtain a pack containing its objects, locate the corresponding `.idx` file, and use `git show-index` to inspect it. Record the first few lines and identify the three fields on a version-2 index line. Then run the same inspection with `--object-format=sha1` and compare the object IDs. Finally, use `git verify-pack -v` on the same index and explain one concrete difference between the two commands.

Advanced ~6 min read

Challenge 1

Complete the Git command to inspect a pack index.

bash Your answer
git 

Press Ctrl⌘Enter to check your answer

Challenge 2

Complete the Git command to inspect a pack index.

bash Your answer
git  < .git/objects/pack/pack-<id>.idx

Press Ctrl⌘Enter to check your answer

Challenge 3

Complete the Git command to inspect a pack index.

bash Your answer
git  --object-format=sha1 < .git/objects/pack/pack-<id>.idx

Press Ctrl⌘Enter to check your answer

Challenge 4

Complete the Git command to inspect or verify pack data.

bash Your answer
git  -v

Press Ctrl⌘Enter to check your answer