How can I do a git diff in the opposite direction in the Atlassian SourceTree desktop app? In other words, how do I get SourceTree to do git diff b a instead of git diff a b?
e.g., if my commits are in this order in my commits pane:
3333
2222
1111
and I select 3333 and 1111, it will show me a diff of changes from 1111 to 3333 (i.e, git diff 1111 3333).
How do I make it do a git diff in the other direction, so that it's a diff of changes from 3333 to 1111 (i.e., git diff 3333 1111)?
(NOTE: this question is specifically about how to do this in the Atlassian SourceTree desktop app, not how to do it in git in general.)
Here is a screenshot showing where I selected 2 commits in SourceTree to see the diff
Supposing you need to diff a specific branch from your current branch, the only way is the Berik answer because is not possible to inform branch as second argument.
So this show diff normal order:
git diff branch_abc Makefile
and this show diff on reverse order:
git diff -R branch_abc Makefile
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With