What is inside git stash?

Steven Hough
1 min readJan 4, 2021

--

https://www.bizjournals.com/chicago/news/2018/10/01/treasure-island-grocery-store-chain-shutting-down.html

From the man git-stash page:

The modifications stashed away by this command can be listed with git stash list, inspected with git stash show

show [<stash>]       Show the changes recorded in the stash as a diff between the stashed state and its original parent. When no <stash> is given, shows the latest one. By default,the command shows the diffstat, but it will accept any format known to git diff
(e.g., git stash show -p stash@{1} to view the second most recent stash in patch form).

To list the stashed modifications

git stash list

output :-

stash@{0}: WIP on ...
stash@{1}: ...
stash@{2}: ...
...

To show files changed in the last stash

git stash show

This will show you the files that changed in your most recent stash. You can add the -p option to show the diff. So, to view the content of the most recent stash, run

git stash show -p

To view the content of an arbitrary stash, run something like

git stash show -p stash@{1}

--

--

Steven Hough

Software Engineer and Blogger: Code Creator and Word Weaver