Align a phased file with one in stash

Is there an option -staged (aka -cached) to compare files from git stash?

Here I compare the last commit with a phased file (I use the explicit @ {} syntax, but I know that @ {0} can be inferred):

git diff stash@{0}:spec/blueprints.rb HEAD:spec/blueprints.rb

And here I am comparing the hidden file with what is on the disk:

git diff stash@{0}:spec/blueprints.rb spec/blueprints.rb

How can I compare what is currently delivered with what was in the cache? This does not work:

git diff --staged stash@{0}:spec/blueprints.rb spec/blueprints.rb
+3
source share
2 answers

git diff --cached 'stash@{0}' -- spec/blueprints.rb

... Quotations may not be needed, but you never know how your shell may surprise you.

+3
source

:<n>:<path>, e.g. :0:README, :README

, ( 0 3) , , blob . ( , ), 0. 1 , - ( , ), 3 - , .

from git help rev-parse

0

All Articles