0
0
Gitdevops~5 mins

Dropping and clearing stashes in Git - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the command git stash drop do?
It removes a specific stash entry from the stash list, freeing up space and cleaning up unused stashes.
Click to reveal answer
beginner
How do you remove all stash entries at once?
Use git stash clear to delete all stashes in one command.
Click to reveal answer
intermediate
What is the difference between git stash drop and git stash pop?
git stash drop deletes a stash without applying it, while git stash pop applies the stash changes and then deletes it.
Click to reveal answer
intermediate
How can you specify which stash to drop?
You specify the stash by its name or index, for example: git stash drop stash@{2} drops the third stash.
Click to reveal answer
beginner
Why is it important to clear or drop stashes regularly?
Because stashes take up space and can clutter your repository, clearing unused stashes keeps your workspace clean and organized.
Click to reveal answer
Which command removes all stash entries at once?
Agit stash apply
Bgit stash drop
Cgit stash pop
Dgit stash clear
What happens when you run git stash drop stash@{0}?
AIt deletes the most recent stash without applying it
BIt applies the stash and deletes it
CIt clears all stashes
DIt lists all stashes
Which command applies a stash and then removes it from the stash list?
Agit stash drop
Bgit stash pop
Cgit stash clear
Dgit stash list
If you want to remove a stash but keep its changes for later, which command should you NOT use?
Agit stash apply
Bgit stash pop
Cgit stash drop
Dgit stash list
What is the default stash that git stash drop removes if no stash is specified?
Astash@{0} (most recent stash)
Bstash@{1} (second most recent stash)
CAll stashes
DNo stash is removed by default
Explain how to safely remove a specific stash entry and why you might want to do this.
Think about how to target one stash and the benefit of cleaning up.
You got /4 concepts.
    Describe the difference between clearing all stashes and dropping a single stash.
    Consider when you want to remove everything vs just one stash.
    You got /4 concepts.