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:

3333
      2222
      1111

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

This widget could not be displayed.

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 widget could not be displayed.

This would be an incredibly useful feature - I submitted a JIRA feature request for this here https://jira.atlassian.com/browse/SRCTREE-2176

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

This widget could not be displayed.

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 Sign up to answer
Community showcase
Posted Thursday in United States

Local Atlassian Research Workshop opportunity on Sep. 28th

We're looking for participants for another workshop at Atlassian! We need Jira admins who have interesting custom workflows, issue views, or boards. Think you have a story to sh...

85 views 0 0
View post

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