It was very easy in Sourcetree but this tool is not available on Linux
3 Answers
gitk shows the content of your stash:
$ gitk --all&
Since both the index and the working tree are saved in stash, you see both, and the diff looks a bit different than what you might be used to.
$ git stash show -p
shows the stash content on the command line. If you have several stashes, you can specify the stash name, e.g. stash@{3}
.
-
-
1This is not working: on my repository, this shows only the last entry, and in the middle of thousands of other non-stash entries, so this would take me hour to find out it out if I do not know in advance the exact name of the commit. It is not even possible to filter the entries with "stash" keyword– calandoaMar 9, 2016 at 16:52
-
@calandoa: I assumed the stash was recent and in the vicinity of the checked out commit. See if my edit better fits your need.– GauthierMar 10, 2016 at 7:56
-
1@calandoa: You can find the latest stash easily using "File" > "List references" > Click "stash".– 203967Dec 12, 2016 at 21:52
-
2@calandoa: The possibility of showing all the stashes instead of just the last [stash] entry is being studied link, backup link; if you really thrive at it you can even apply a patch yourself using this gist. Apologies the state is kind of early alpha, but it mostly would work OK.– 203967Dec 12, 2016 at 21:54
I tried several GUIs without success, though I may have missed some options:
- gitk (check my comment in the other answer)
- git gui
- giggle
- gitkraken
The ones which worked fine:
- gitg (show the stash by default at the top of other commits)
- tig with "tig stash" (text UI but very handy)
-
1It's tricky now, but if in huge need
gitk
can be tweaked to show all stashes, see the comment history of the other answer.– 203967Dec 12, 2016 at 21:59 -
See also https://stackoverflow.com/questions/3573623/is-it-possible-to-preview-stash-contents-in-git/23893369#comment62874363_23893369 about multiple stashes in
gitk
.– 203967Jul 4, 2017 at 19:40