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

Git Remote Helper

Greg Lusk June 19, 2013

I am using SourceTree on Mac. I have a remote helper set up that allows my native Git client to connect to a Mercurial repository. When I attempt to clone my Hg repo with a URL like 'hg::<url>', SourceTree reports that Git cannot find a remote helper. I have SourceTree set up to use my native Git client, and my Git client can clone from the command line.

Can you suggest how I can make this work with SourceTree?

Thanks,

1 answer

1 accepted

1 vote
Answer accepted
stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 20, 2013

I'm guessing you've made some changes to your PATH or other environment settings in your terminal in order to make the remote helper work there. On the Mac, changes to the terminal's environment are not visible to full OS X apps, because they are launched by a service called 'launchd' and not via sh/bash where you would have made your environment changes.

You can tackle this 2 ways:

  1. Make your helper not reliant on additions to the environment, so don't rely on additions to the PATH etc, or
  2. Alter the environment that affects OS X apps too. This means editing /etc/paths or adding files to /etc/paths.d to alter PATH, or editing /etc/launchd.conf to set other environment vars (also ~/launchd.conf). See http://www.dowdandassociates.com/content/howto-set-an-environment-variable-in-mac-os-x-slash-etc-slash-launchd-dot-conf/ for the format.
Fernando L. Garcia Bermudez November 22, 2013

@Steve, I've made sure that git-remote-hg is in the path (symlinked it to /usr/local/bin, which is part of /etc/paths by default) and am able to use it from the terminal by issuing:

# git fetch origin

where

# git remote -v
origin	hg::/path/to/origin (fetch)
origin	hg::/path/to/origin (push)

When I launch SourceTree and try to fetch from that remote in the GUI, I get:

git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree fetch origin 
fatal: Unable to find remote helper for 'hg'
Completed with errors, see above

Any idea why this might not be working? I didn't add the path to /etc/paths.d as it'd be redundant there and I haven't yet tried modifying launchd.conf.

I'm running system git version 1.8.4.3 installed via homebrew under /usr/local.

KieranA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 24, 2013

@Fernando,

It's important to note that SourceTree runs in its own environment entirely, and thus has its own PATH env var. If you've set up a remote helper for your repository and that helper is located on your PATH env var ('echo $PATH' on the terminal) then it won't be available from SourceTree.

This is just the way Mac apps work unfortunately.

Cheers

Fernando L. Garcia Bermudez November 24, 2013

@Kieran,

That's what @Steve had noted in his answer, but he also gave a few suggestions on how to ensure that the helper appears in SourceTree's PATH. This is somehow not working for me, so maybe I'm misunderstanding his answer.

If I can't control what's in SourceTree's PATH, maybe I can just symlink git-remote-hg to a folder already accesible to it. What's its default PATH?

Thanks!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events