Challenge - 5 Problems
Stash Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
What is the output of dropping a stash by name?
You have a stash named
stash@{1}. What is the output of the command git stash drop stash@{1}?Git
git stash drop stash@{1}
Attempts:
2 left
💡 Hint
Dropping a stash by its exact name removes it and confirms the action.
✗ Incorrect
The command
git stash drop stash@{1} removes the stash at index 1 and outputs a confirmation message like 'Dropped stash@{1} (message)'.💻 Command Output
intermediate2:00remaining
What happens when you clear all stashes?
What is the output of running
git stash clear when you have multiple stashes saved?Git
git stash clearAttempts:
2 left
💡 Hint
Clearing stashes removes all without confirmation or output.
✗ Incorrect
The
git stash clear command deletes all stash entries silently without any output.❓ Troubleshoot
advanced2:00remaining
Why does
git stash drop fail with ambiguous argument error?You run
git stash drop stash@{foo} and get the error: fatal: ambiguous argument 'stash@{foo}': unknown revision or path not in the working tree. What is the most likely cause?Git
git stash drop stash@{foo}Attempts:
2 left
💡 Hint
Check if the stash name matches an existing stash exactly.
✗ Incorrect
The error means the stash name given is not found or invalid. Stash names must be valid references like
stash@{0}.✅ Best Practice
advanced2:00remaining
What is the safest way to remove a specific stash without affecting others?
You want to remove only the stash at index 2 without touching others. Which command should you use?
Attempts:
2 left
💡 Hint
Dropping a stash by its exact name removes only that stash.
✗ Incorrect
The command
git stash drop stash@{2} safely removes only the stash at index 2. git stash clear removes all stashes. pop applies and removes, which may affect working files. apply does not remove the stash.🔀 Workflow
expert3:00remaining
Order the steps to safely clear all stashes after backing them up
You want to save all current stashes as patches before clearing them. Put the steps in the correct order.
Attempts:
2 left
💡 Hint
List stashes first, export each, then clear.
✗ Incorrect
First list all stashes to know their indexes. Then export each stash as a patch file. After backing up all, clear all stashes safely.