Open Zuline opened 7 years ago
Hi @Zuline, due to limitations in SourceTree, remote helpers only work if you use "system git": https://confluence.atlassian.com/sourcetreekb/using-embedded-git-or-system-git-in-sourcetree-785323587.html
Does that fix it?
@strib I found other workarounds too. You can symlink our git-remote-helper into the embedded git dir. Or change the $PATH
that launchd sets to include /usr/local/bin
.
/Applications/Sourcetree.app/Contents/Resources/git_local/bin/
is where their embedded git is kept....
@chrisnojima did we come up with other solutions?
The other thought was to ensure that /usr/local/bin was picked up by sourcetree itself. We were going to reach out to them to see if they'd do that themselves, you could theoretically just make a shortcut or script or something that just does this itself like a terminal alias (I haven't tested this)
PATH=$PATH:/usr/local/bin /Applications/SourceTree.app/Contents/MacOS/SourceTree
@strib thanks for the rapid response...it doesn't fix it. Sourcetree was using local git. I reset it and restarted...still the same issue.
@chrisnojima executing your code in the terminal invokes Sourcetree in CLI mode and, when asked, it pushes successfully. Interestingly it doesn't have an awareness that it's one behind the remote when invoked in that mode. Who knows why...
@maxtaco Thanks Max, it would be nice to have a clean solution to this for non-tech users.
Hello - I just came looking for the solution to this exact problem.
While I had previously configured ST to use system git, the push to my keybase repo failed similarly to that described in the 1st post. I found if I carefully selected /usr/local/bin/git
in ST preferences then ST does use it and I have full access to my keybase repo. By 'carefully' I mean I took a couple of attempts to set this. For some reason my first attempts failed.
FYI: SourceTree reports version 2.6.3 and 2.14.1 for System Git
Update: I believe I figured the problem.
On my system /usr/local/bin/git
is a symlink to /usr/local/git/bin/git
. When I selected /usr/local/bin/git
via the file select dialog I did so by doubling clicked on the symlink. This appears to have caused ST to actually point to the linked file (ie /usr/local/git/bin/git
), not the link itself. (Hope that is clear!). This is noticeable via a rapid update to the dialog before it then disappears.
If I instead selected /usr/local/bin/git
in the dialog with a single click and then pressed the dialog Open button to accept the change, this caused ST to directly use /usr/local/bin/git
. The path difference means the keybase helper can now be found in the same directory as the called git symlink.
My fix… (for Max OS 10.13.3 and SourceTree 2.7.1) PATH was correct, but /usr/local/bin /git-remote-keybase was not getting picked up add a link for git: ln -s /usr/bin/git /usr/local/bin/git change SourceTree to system git and select /usr/local/bin/git
Voila, everybody in the same directory and happy as a clam
maybe keybase can add this link when setting up git?
Had the same problem on Mac OS (10.13.4) with Sourcetree (2.7, 152) and Tower (2.6.4, 357). Thanks to @sphardy and @randarnold, I found what was wrong:
/Applications/Keybase.app/Contents/SharedSupport/bin/
in /usr/local/bin/
, so I created those;/usr/bin/git
in /usr/local/bin/
, so I created it;/usr/local/bin/git
(not /usr/bin/git
!) solved the problem for me.I guess, placing Keybase utils symlinks into /usr/bin/
would fix the problem as well, and then there will be no need in creating a /usr/local/bin/git
symlink.
I set up a couple of trial repos. I love the way it works from the CL. However some of our team use Sourcetree as their GIT GUI of choice.
All goes well until you try to push to the remote and you get:
Sourcetree Mac 2.3.2 (75)