0
0
Gitdevops~3 mins

git stash list to view stashes - Commands & Configuration

Choose your learning style9 modes available
Introduction
Sometimes you need to save your work temporarily without committing it. Git stash lets you do that. The command git stash list shows all the saved work snapshots you have stored.
When you want to switch branches but have unfinished changes you don't want to commit yet
When you need to quickly save your current work and try something else without losing progress
When you want to clean your working directory temporarily but keep your changes safe
When you want to see all your saved work snapshots before deciding which one to apply
When you want to manage multiple sets of changes saved for later use
Commands
This command shows all the saved stashes with their names and descriptions so you can see what work you saved before.
Terminal
git stash list
Expected OutputExpected
stash@{0}: WIP on main: 1a2b3c4 Fix header layout stash@{1}: WIP on feature-branch: 5d6e7f8 Add login button
Key Concept

If you remember nothing else from this pattern, remember: git stash list shows all your saved work snapshots so you can manage them easily.

Common Mistakes
Running git stash list without having any stashes saved
The command will show no output, which might confuse you into thinking it failed.
Make sure you have saved stashes using git stash before running git stash list.
Confusing git stash list output with branch names
Stashes are not branches; they are temporary saved changes and have different naming.
Understand that stash@{0}, stash@{1}, etc., are saved snapshots, not branches.
Summary
git stash list shows all saved stashes with their descriptions.
Use it to check what work you saved temporarily before applying or dropping.
It helps you manage multiple saved changes without committing them.