tags:

views:

22

answers:

1

Given this result of git status:

modified: path/to/file-1.txt
modified: path/to/file-2.txt

Is there a shortcut equivalent of this?

git diff path/to/file-1.txt

Something like:

git diff {1}

So that I don't have to type the full path name.

I know git stash allows git stash show stash@{1}, so I believe there's something similar for git diff, but I haven't found it yet.

Thanks.

+1  A: 

git stash operates on a stack whereas git diff does not. Hence the stack contents can be referred to, but not the other.

Alan Haggai Alavi