Skip to content
Foxipa
Code Completion 4 Challenges

Complete the Git commands: Git Stash Inspection, Application, and Recovery

Create a disposable repository with at least two stash entries. Use `git stash list` to identify them, inspect each with `git stash show` and one with `--patch`, then apply one without deleting it. Verify that the stash remains listed. Create a second disposable branch scenario in which the original branch has moved after the stash was created; use `git stash branch` to recover the stash on a branch based on its original commit. Finally, demonstrate the difference between `drop` and `clear` in separate disposable repositories. Record the exact command, selected stash revision, pre-operation status, post-operation status, and whether the stash entry remains.

Intermediate ~6 min read

Challenge 1

Complete the Git command to store or inspect working-tree changes.

bash Your answer
git  list

Press Ctrl⌘Enter to check your answer

Challenge 2

Complete the Git command to store or inspect working-tree changes.

bash Your answer
git  show

Press Ctrl⌘Enter to check your answer

Challenge 3

Complete the Git command to store or inspect working-tree changes.

bash Your answer
git  branch

Press Ctrl⌘Enter to check your answer

Challenge 4

Complete the Git command to store or inspect working-tree changes.

bash Your answer
git  show stash@{0}

Press Ctrl⌘Enter to check your answer