Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,553,552
Community Members
 
Community Events
184
Community Groups

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

2 votes
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Feb 19, 2014

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

" SourceTree is just a UI wrapper to a git command line client anyway" : yep you made my day

Like sabz20005 likes this

Disagree big time.  Contrast gitextensions which provides a number of command-line entry points to it's gui.  I can bring up it's merge tool, invoke graphical blame, log of a specific file, etc, all from command line.  ditto TortoiseGit.

I'm overwhelmingly primarily a commandline dev but I don't want to view a blame via commandline, but it's usually easier for me to specify a path on the commandline

looks like sourcetree.exe /? provides some help, and there's a few commands status, log, filelog, commit, but it's pretty bare compared to gitextensions or tortoise

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 <arguments to git diff>

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

Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Jun 18, 2014

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.

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.

Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Feb 20, 2014

So what differences would you expect in a SourceTree diff?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events