Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to set PATH for git invocation from Sourcetree?

becoggins April 8, 2022

Does anybody know how to set the PATH environment variable that Sourcetree on macOS uses when invoking git?

Background: For years I have been using a tool called git-remote-dropbox to store git repos for personal projects within my Dropbox account.  These repos are accessed using a dropbox:// URI and git automatically calls the git-remote-dropbox Python script when encountering a remote with such a URI.  It works beautifully...but only if git can find the git-remote-dropbox script.

In the past, opening Sourcetree from the command line with the stree command would cause it to inherit the PATH from the shell, and it would then be able to find the script.

An OS update forced some reworking of the Python installation and I had to reinstall the script to a different path.  I updated PATH in my shell configuration, and the system git can find the script in the new location when invoked from the shell.  But Sourcetree does not seem to be inheriting the new PATH, and git invocations from within Sourcetree can't find the script in the new location.  This is true for both embedded git and system git.

Sourcetree must be getting its PATH from somewhere, but I can't figure out where, or how to set it.  Anybody know?

Workaround:  Further experimentation revealed that /usr/local/bin is on the path seen by git when invoked from Sourcetree, so I got things running by adding a symlink to git-remote-dropbox in /usr/local/bin.  But I'd still like to know if there's a way to configure Sourcetree's PATH variable for git invocation.

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events