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

Launch SourceTree from MacOS terminal?

I had set up an alias in Terminal to open sourcetree for the current-working-directory's reposotory:

$ alias st
alias st='open -a /Applications/ '
$ st .  

... which would then launch sourcetree for whichever project I happen to be in. I have found this far, far more convenient than sourcetree's repo browser.

After upgrading to sourcetree 3.0, this no longer works. I can launch it with:

 /Applications/ .

... however, this doesn't fork/exit, meaning I can no longer continue to use that terminal for other work, which isn't very convenient. Also, it launches multiple copies of SourceTree. Though thankfully ST is not a memory hog (like certain Electron-based developer-targeted productivity apps that I will not name...), it still leaves multiple copies of the app in the Dock, with no indication about which relates to which launched instance.

Are there any other 'launch current repo in sourcetree' shortcuts I'm missing that might work reasonably?

1 answer

0 votes
bgannin Atlassian Team Jun 28, 2019

Hi @matthewf_ucsd,

You can install a command line tool (stree) provided with the app. The menu item (Install Command Line Tools) is under the application menu. The latest version available is 3.2.1 and has been verified with all standard ways of launching.

Hope that helps,

Brian Ganninger
Principal Developer, Sourcetree

After updating, stree still did not work. 

It seems the problem is that I only ran "Check For Updates" once: Doing so installed SourceTree 3.0, rather than the most recent version. A subsequent check-for-updates brought me to 3.2, and a third to 3.2.1.

Now both stree and my previous alias work. Phew!

NB: stree seems to have an inaccurate version number, though I won't complain as long as it works. 

$ stree --version

stree version 1.3 

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Sourcetree

Bug Fix: Sourcetree for Windows authentication error when updating to app password

Hello Sourcetree users!!! With the recent removal of Bitbucket Cloud account passwords for app passwords (please see our Bitbucket Cloud community post for details on why we made this change for se...

61,923 views 127 27
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you