There may be other better variations, but after some experiment I’ve found these work well enough…
- Choose “Custom” for the “External Diff Tool” and “Merge Tool”
- The “Diff Command” in both cases is the path to wherever VS-Code is installed, eg:
C:\Program Files (x86)\Microsoft VS Code\Code.exe
-
The command-line arguments for Diff’ing are:
–diff –wait “$LOCAL” “$REMOTE”
-
And for Merging:
-n –wait “$MERGED”
The ‘-n’ flag makes VS-Code open a new window, which I prefer since VS-Code opens so fast, but you can omit it. When dealing with merge conflicts, you have to close the file when you’re done to continue. SourceTree doesn’t seem to consistently delete the intermediate files it creates, but you can select, right-click and ‘Remove’ them from the un-staged file section easily enough.