Useful SourceTree custom actions bash scripts. It can enable you to:
- Open current repo in Sublime Text
- Open current repo in VS Code
- Open Select commit in Browser(Support github/gitlab)
- Copy current Repo Url to Clipboard
- Open XCode project in XCode
- Stash untracked files by running
git stash --include-untracked, you should stage your changes before running this action. - Reset any local changes by running
git reset --hard HEAD
Tested on Mac, but should work on Linux and Windows(Win10 with SubLinux) too(you may need to alter application path in the scripts)
- download this repo
- unzip and copy
scriptsto some untouched folder, like SourceTree's application data directory~/Library/Application Support/SourceTree/ - open
SourceTreeGo toPreferences -> Custom Actions -> Addand fill custom action with parameters as shown in the figure(add a shortcut if you wish):
If you are using Mac, when browser a repo with SourceTree, you may press ⌘ + shift + / and type the menu item name then press enter to call that menu
You may need to add execution permission via chmod +x *.sh when an error permission denied shown up.
If you are using alfred on macOS, you may try sourcetree-alfred-workflow also created by me