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

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


1 badge earned


Participate in fun challenges

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


Gift kudos to your peers

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


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!


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
Community Members
Community Events
Community Groups

SourceTree command line option?

Is it possible to specify a repository to open in a SourceTree command line option? If so, how?

1 answer

5 votes
KieranA Rising Star Mar 24, 2013

Hi Michael,

If you install the command line tools from the SourceTree menu you can then run "stree" from the terminal. Here's the menu:

Hope that helps

i am running the Windows version of SourceTree and do not see a menu command for "Install Command Line Tools". Am I missing something, or is it not available on Windows? If not available, are there plans to implement it for windows?

This isn't supported yet in Windows but isn't actually that hard - you can already launch SourceTree.exe from the command line and it will automatically activate the current instance if there is one - you just can't pass a file path right now (it's only used for the Clone In SourceTree button on Bitbucket right now). Tracking here:

Where is SourceTree.exe located? Since it is "click once" doesn't it get located in a different place every time it is installed?

Ah, good point - unfortunately ClickOnce moves it subtly every update (seems to calculate a hash to use in the folder name). You can always see the current location in the registry because of the URL handler hook, if you look under HKEY_CURRENT_USER\Software\Classes\sourcetree\shell\open\command

What's about about arguments that I can pass to stree?

+1 for arguments
i want to open the file changes history panel from the command line if possible
or at least find help on any available options

Create a stree.ps1 file in a directory contained in $PATH with this content:

Start-Process "C:\Program Files (x86)\Atlassian\SourceTree\SourceTree.exe"  -ArgumentList "-f $((Resolve-Path $args[0]).toString())"

Then you can just call stree . or stree ../relative/path

Bit late to the party :)

In a cmd-Window:

[installpath]\SourceTree.exe -f [path to repo] log -> opens in log (history) view

[installpath]\SourceTree.exe -f [path to repo] status -> opens in status (commit) view

[installpath]\SourceTree.exe /? pops a messagebox for commandline options



Suggest an answer

Log in or Sign up to answer

Atlassian Community Events