Interview Q&A / Git & GitHub

BeginnerQuick answer1 min readUpdated 3 Oct 2026

How do you list, name and inspect your stashes?

SHORT ANSWER

Save with git stash push -m 'message' so each stash has a label, list them with git stash list, and see their contents with git stash show -p stash@{n}.

Explain it simply

A pile of unlabeled sticky notes is useless. Naming each stash makes the pile searchable.

Stashes form a stack: stash@{0} is the newest. git stash list shows them with your messages. git stash show stash@{1} prints a summary of changed files, and adding -p shows the full diff. Apply or drop a specific one by index, for example git stash apply stash@{2}. Stashes are local; they are never pushed.

Example

bash
git stash push -m "navbar experiment"
git stash list
# stash@{0}: On main: navbar experiment
git stash show -p stash@{0}
git stash apply stash@{0}

What to say in the interview

"I use git stash push -m to label stashes, git stash list to see the stack, and git stash show -p to read a stash before applying it. Stashes are local only and indexed from stash@{0}, the newest."

#git#stash#list

Related questions

Practise more Git & GitHub questions

Test your recall with short answers, then return to the detailed explanations when you need context.

Open Git & GitHub quick answers →

Get new questions like this by email

One short email when something new and useful lands. No spam, unsubscribe in one tap.

By subscribing you agree to the Privacy Policy.