SourceTree has a window called unstaged files where it shows files whose changes have not been committed. I want to right click on the file name & open it in an external editor. So I added a custom action -> Edit -> pathtoeditor\editor.exe $REPO\$FILE.
This launches the editor. But SourceTree also keeps showing a progress bar. The progress bar closes only after I close the external editor.
How do I avoid this? After opening the file in the external editor, I want SourceTree's UI to return to its normal state without waiting for the editor to exit.
This is an old question, but if someone else is looking for the answer currently the easiest way to accomplish this is to follow these steps
Now if you right click on a file in Sourcetree and go to the custom actions menu it will now have the action you created. Click on it and it will open in the application you selected without keeping the progress bar open for no reason.
Make a .bat file, say..."launchNotepad.bat" like so
@call pathtoEditor\editor %1
Make the batch file your script target, and your parameters stay as $REPO\$FILE. This'll make launching the editor your action, rather than the editor itself.
This has a few other advantages, like SourceTree picking up on updates to the batch file without having to restart it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With