Ionuț G. Stan
Ionuț G. Stan

Reputation: 179119

Shortcut for specifying modified files as arguments to git diff

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.

Upvotes: 2

Views: 252

Answers (2)

holygeek
holygeek

Reputation: 16185

Checkout git-number, or scm-breeze.

Upvotes: 2

Alan Haggai Alavi
Alan Haggai Alavi

Reputation: 74202

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

Upvotes: 1

Related Questions