We configure our diff visual tool using diff.tool=xxx
and then running git difftool
to see a visual diff. You can see a stash using git stash show
- but how can you see the stash visually like you can with diff?
Asked
Active
Viewed 1,628 times
4

Community
- 1
- 1

Marcus Leon
- 55,199
- 118
- 297
- 429
2 Answers
7
Just use the stash's name. For example, the following works for me:
git diff branch stash@{0}

choroba
- 231,213
- 25
- 204
- 289
-
Thanks, that works. (replace diff with difftool to get the visual diff) – Marcus Leon Aug 28 '16 at 12:44
-
More thoughts on using diff to see stash @ http://stackoverflow.com/questions/7677736/git-diff-against-a-stash?rq=1 – Marcus Leon Aug 28 '16 at 12:45
-
@ObjectNameDisplay: Is your branch really named "branch"? – choroba Jul 31 '18 at 19:56
-
@ObjectNameDisplay: So use the name of the actual branch instead of `branch`. – choroba Aug 01 '18 at 07:18
-
I found: `git diff stash@{0}` works quite well for the current branch. – will Sep 23 '21 at 03:39
0
Using git diff ..stash@{0}
(equivalent to the answer by @choroba) does not work well if the base branch of the stash is significantly different than your current branch.
A stash is essentially a merge commit so the most simple way to view the changes stored in a stash is git show
:
git show stash@{0}
Which is roughly equivalent to this if you prefer to use diff
:
git diff stash@{0}^..stash@{0}

ColinM
- 13,367
- 3
- 42
- 49