Skip to content
Foxipa
Code Completion 4 Challenges

Complete the Git commands: Git Show: Reading Committed Snapshots

Create a disposable repository with two commits. Inspect the second commit with `git show`, then inspect the first commit explicitly. Use `--no-patch` to inspect commit information without the patch, and use a path restriction to inspect only the file changed by the second commit. Finally compare the two snapshots with `git diff` and explain why the outputs answer different questions.

Beginner ~6 min read

Challenge 1

Complete the Git command to inspect a snapshot or object.

bash Your answer
git 

Press Ctrl⌘Enter to check your answer

Challenge 2

Complete the Git command to inspect a snapshot or object.

bash Your answer
git  HEAD

Press Ctrl⌘Enter to check your answer

Challenge 3

Complete the Git command to inspect a snapshot or object.

bash Your answer
git  HEAD~1

Press Ctrl⌘Enter to check your answer

Challenge 4

Complete the Git command to inspect a snapshot or object.

bash Your answer
git  --no-patch HEAD

Press Ctrl⌘Enter to check your answer