SourceTree: how to do a diff in the opposite direction?

How can I do a diff in the opposite direction in SourceTree? In other words, how do I get SourceTree to do diff b a instead of diff a b?

e.g., if my commits are in this order in my commits pane:


and I select 3333 and 1111, it will show me a diff of changes from 1111 to 3333 (i.e, diff 1111 3333).

How do I make it do a diff in the other direction, so that it's a diff of changes from 3333 to 1111 (i.e., diff 3333 1111)?

Here is a screenshot showing where I selected 2 commits in SourceTree and the corresponding diff:

3 answers

1 accepted

Not a the moment I'm afraid, the diff between commits is always shown in 'forward history' order.

Bummer! :-( Thanks Steve, I appreciate you letting me know! :-)

This would be an incredibly useful feature - I submitted a JIRA feature request for this here

As a workaround, for now I use the commandline solution

git checkout branch1
git merge --no-commit branch1

and preview the potential merge changes in SourceTree

It's not possible, per @Steve_Streeting's answer, but here are some alternatives:

1. Use a different external GUI diff viewer

2. Copy the files from older commit 1111 into the working tree for newer commit 3333, and then see the diffs in the working tree, e.g.,

cd {repo}
git diff --name-only 3333..1111 > /tmp/list_of_files_changed
git checkout 1111
mkdir /tmp/files_changed
cp --parents -pr $(cat /tmp/list_of_files_changed) /tmp/files_changed
git checkout 3333
cp -pr /tmp/files_changed/* .
# (now look at the diff in SourceTree for the working copy)

Suggest an answer

Log in or Join to answer
Community showcase
Louis De Jaeger
Posted yesterday in Off-topic

Friday fun: your best joke

Hi all Lets make this Friday fun really fun and post one (or more) of your best jokes! The joke can be about an Atlassian product, or just a really fun joke you want to share! I’m not the best j...

72 views 2 2
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot