How can I use SourceTree from the command line to browse the differences between two commits

Hi,

I would like to do something like this:

open -a SourceTree puppetlabs-apache 8340107...97b5594ffd3b7fec169f807d3dee07cb094982a5

Thanks!

Alan

4 answers

If you want to use the command line, you should just use the git client. SourceTree is just a UI wrapper to a git command line client anyway.

git diff 8340107 97b5594ffd3b7fec169f807d3dee07cb094982a5

https://www.kernel.org/pub/software/scm/git/docs/git-diff.html

I'd like be able to browse an active project between releases to see changes and the commit logs for each change. 'git diff branch..branch' is very file oriented. I will do a 'git diff --name-status branch1..branch1' sometimes.

I do this as well...

git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"

git lg -p branch1..branch2 and it's pretty good looking but it's not very usable on large numbers of changes.

So what differences would you expect in a SourceTree diff?

Hi Seth,

I don't understand your question. I'm trying to determine if I can invoke sourcetree from the command line and browse the changes between two commits. I do this currently with git on the command line but it's really tedious when you have an active project with a lot of committers.

A good example of this is when you are browsing down commits and you see a file diff and you would like to step sideways through changes on that file with log display.

Alan

GitX has a feature like this: you can do

gitx --diff &lt;arguments to git diff&gt;

and see the diff nicely formatted. SourceTree should have a similar command.

As far as I know, SourceTree is exclusively GUI. The only commands it provides are alternate ways to launch the GUI.

I should have been clearer. The GitX command above opens the diff *in the GUI*, and I would expect any similar SourceTree command to so likewise.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Brian Ganninger
Published Jan 23, 2018 in Sourcetree

Tip from the team: workflow and keyboard shortcuts

Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...

647 views 0 4
Read article

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