0
0
Gitdevops~20 mins

git stash list to view stashes - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Git Stash Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
What is the output of git stash list after creating two stashes?
You have created two stashes in your git repository using git stash twice. What will git stash list show?
Git
git stash list
A
stash@{0}: WIP on main: 123abc4 Fix header layout
stash@{1}: WIP on main: 567def8 Add footer styles
BNo stashes found
C
stash@{1}: WIP on main: 123abc4 Fix header layout
stash@{0}: WIP on main: 567def8 Add footer styles
DError: stash list command not found
Attempts:
2 left
💡 Hint
Remember that the most recent stash is listed as stash@{0}.
🧠 Conceptual
intermediate
1:30remaining
What does git stash list show?
Choose the best description of what git stash list displays.
AThe current status of the working directory.
BA list of all branches in the repository.
CThe commit history of the current branch.
DA list of all saved stashes with their names and commit messages.
Attempts:
2 left
💡 Hint
Think about what you save when you stash changes.
Troubleshoot
advanced
2:00remaining
Why does git stash list show no output after stashing changes?
You ran git stash to save changes, but git stash list shows nothing. What could be the reason?
AYou had no changes to stash, so nothing was saved.
BYour git version does not support stashing.
CThe stash list is hidden by default and needs a flag to show.
DYou ran <code>git stash list</code> in a different repository.
Attempts:
2 left
💡 Hint
Think about what happens if you stash without any changes.
🔀 Workflow
advanced
1:30remaining
How to view details of a specific stash from git stash list?
After running git stash list, you want to see the detailed changes saved in stash@{1}. Which command do you use?
Agit stash show -p stash@{1}
Bgit stash list stash@{1}
Cgit stash apply stash@{1}
Dgit stash drop stash@{1}
Attempts:
2 left
💡 Hint
You want to see the patch details without applying the stash.
Best Practice
expert
2:00remaining
What is the best practice to keep your stash list manageable?
You have many stashes saved and want to keep your stash list clean. What is the best practice?
ANever drop stashes to keep all changes saved forever.
BRegularly apply or drop stashes you no longer need.
CRename stashes to long descriptive names to avoid confusion.
DUse <code>git stash clear</code> daily to delete all stashes.
Attempts:
2 left
💡 Hint
Think about managing clutter and keeping only useful stashes.