How do you open SourceTree from the command line?

Installing the SourceTree Command Line Tools will provide you with the stree command. This will allow you to open the current directory in SourceTree.

sourcetree commandline tools

You can also specify a particular path to a repo

stree ~/my-repo-in-another-folder

If installing command-line tools isn’t an option for whatever reason, you can also do the following:

open -a SourceTree path-to-file

and maybe set up an alias in .bashrc or .zshrc

alias sourcetree="open -a SourceTree"

For those who are using SourceTree 3

alias sourcetree="open -a SourceTree\ 3"

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)