Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to do a git diff <commit>...<working tree>?

Tags:

git

It's straightforward to do a git diff <commit>...<some other commit>, but how can I achieve something equivalent to specifying "working tree" as the last argument in that command? I've tried git diff <commit>..., git diff <commit>... ., etc, but they don't actually pick up my changes in the working tree.

Bonus points if <commit> can be a remote branch =)

like image 908
Suan Avatar asked Jan 30 '26 11:01

Suan


1 Answers

With ... you are implicitly specifying HEAD. You want the single argument version of diff to diff against the working tree.

git diff <commit>

<commit> can be anything that refers to a commit such as the name of a remote-tracking branch.

like image 146
CB Bailey Avatar answered Feb 02 '26 05:02

CB Bailey