SourceTree: how to do a git diff in the opposite direction?
This is not possible in SourceTree.
I asked this question here on answers.atlassian.com and found out from an Atlassian employee that the ability to do a diff in the opposite direction is not available, that a diff between commits is always shown in "forward history" order.
Some alternatives:
- Use a different external GUI diff viewer
-or- - 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)
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