You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Then, go to SourceTree,Preferences -> Custom Actions -> Add, filling the options like this:
Menu Caption: a custom name for that action;
[x] Show Full Ouput: mark it;
Script to run: navigate to$HOME/Library/Application Support/SourceTree/scripts folder (in macos or, in Windows,%USERPROFILE%\AppData\Local\Atlassian\SourceTree\) and pick the one you are setting up;
And it's done! Remember that you need to do this process to each of the scripts you want to use as a Custom Action in your machine.
Updating
You can download latest zip, or run the following command:
# macosCWD=`pwd`&& \cd"$HOME/Library/Application Support/SourceTree/scripts"&& \ git pull&& \cd$CWD# or, in Windows# set "CWD=%CD%" & cd /d "%USERPROFILE%\AppData\Local\Atlassian\SourceTree\scripts" & git pull & cd /d "%CWD%"
So, you get the latest versions of the scripts.
Usage
While working in your repositories as normal in SourceTree, go toActions -> Custom Actions and pick the one you want to use.
Extra - Usage via CLI
I suggest you adding the folder$HOME/Library/Application Support/SourceTree/scripts/bin in your$PATH environment variable (in macos or, in Windows,%USERPROFILE%\AppData\Local\Atlassian\SourceTree\ to%PATH%). This way, you can use the same scripts via CLI just calling script name, instead of needing to type the full path to each script.
In case you are usingbash as your shell, you can do this: