10
  • os: mac os 10.8.3
  • xcode: 4.6.3 w command line tools installed
  • /usr/local/bin/git -> /usr/local/git/bin/git

any ideas how to fix?

(the discussion threads i was able to find on the topic mentioned a) installing the command line tools and b) making sure that /usr/local/bin was included in the PATH, both of which i seem to have done here.)

thank you in advance.

git init
dyld: lazy symbol binding failed: Symbol not found: ___strlcpy_chk
  Referenced from: /usr/local/bin/git
  Expected in: /usr/lib/libSystem.B.dylib
oana
  • 111
  • 1
  • 1
  • 6
  • i should also add that i am able to create new repository at the same location using the github client for mac – oana Apr 07 '14 at 19:02

4 Answers4

8

I came up with this issue because I installed git-2.2.1-intel-universal-mavericks.dmg, actually mavericks(10.9.x) is latter version than mountain lion(10.8.x), and snow-leopard is earlier than mountain lion, after I installed git-2.2.1-intel-universal-snow-leopard, this issue had gone.

Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
Robin Liu
  • 81
  • 1
  • 2
  • Thanks. I am also running osx 10.8.5 and Xcode 5.0.1. This was solution for me. – dval Feb 27 '15 at 02:42
  • It helped me aswell :) – Sajeetharan Feb 21 '16 at 13:38
  • A bit of an old topic, but had the same issue with downloading the newest version of git and then trying to use autocomplete. Reinstalling using `git-2.3.5-intel-universal-snow-leopard` from SourceForge fixed the issue! – Jon Gallup Jun 23 '16 at 20:03
3

I had the exact same issue and this is how I fixed it,

Followed this article to install command line tools for xCode(I got xCode 5.1).

Then also edited my .bash_profile

$vi ~/.bash_profile

export PATH=$PATH:/usr/local/git/bin/

Even after doing these 2 things, I was getting the same error with git command line. But then I had Restart my computer to it to work.

Hope this will help.

Thanu
  • 2,481
  • 8
  • 34
  • 53
  • thanks Thanu. unfortunately the restart didn't do the trick in my case. – oana Apr 11 '14 at 13:26
  • Oh sorry to hear that :(, may be try to upgrade your xCode to 5.1.1, and see how it goes. – Thanu Apr 14 '14 at 01:18
  • 1
    This worked for me, just a little sidenote: I had to create .bash_profile first and add the line you posted. After a reboot it worked. – Florian Rachor Dec 02 '14 at 13:27
  • 2
    just download git-2.2.1-intel-universal-snow-leopard.dmg as suggested below, no need to download and install >4GB xcode for that – yetanothercoder Mar 28 '15 at 14:58
  • 1
    For anyone on Mountain Lion, your problem **might** be that you've installed Git 2.2.1 for Mavericks. Visit the downloads page and select the Snow Leopard installation instead. This addressed the issue for me, while reinstalling Command Line Tools and fudging with other nonsense didn't. If you do install Command Line Tools, it will include an old version of Git, so to ensure you're using 2.2.1 (or whatever the version is when you read this), just add `/usr/local/git/bin` to your `PATH`. – orokusaki Apr 02 '15 at 03:49
3

Oana, I was also having troubles with the same error message you quoted. I tried the PATH trick (didn't help). I wasn't really interested in installing Xcode and then the 'Command Line Tools' as others had suggested. But I did stumble upon half an answer.

First, I uninstalled my current version of Git (1.9.2). I then found that it is possible to install the Command Line Tools by themselves, without installing Xcode:

Xcode page: https://developer.apple.com/xcode/ ->

Downloads near the top ->

Scroll down to 'Additional Tools'->'

View Downloads'-> Command Line Tools (OS X Mountain Lion)

With those installed, doing 'git --version' returned this:

git version 1.8.5.2 (Apple Git-48)

The file "/usr/lib/libSystem.B.dylib" was untouched during this process. Or at least, the file size and date did not change.

It is my guess that the issue was created in a more recent version of git, one that is checking for the symbol in question, whereas the older versions don't check for it. I thought about testing that theory and found the older source code for various versions of Git, but didn't have time to spend compiling/installing/testing each one to see if this theory is correct. And I didn't see a simple method of uninstalling the 'command line tools'. Maybe someone else is more intrepid. :)

-- J

Community
  • 1
  • 1
Cronk
  • 453
  • 1
  • 6
  • 16
  • As stated elsewhere, this is not really fixing the problem: it says how to install Apple's own git binaries, now rather old, and not how to get an up to date version. – johnfo Sep 15 '14 at 16:51
  • Correct, it does not install the latest version. But the original question, nor the described fixes (or half fix in my case), ever restricted it to, or described it as, installing the latest version, though. – Cronk Sep 16 '14 at 21:12
0

If you're using SourceTree, it comes with its own version of git and the above solutions won't work. You have to go to Preferences>Git and change the setting from Embedded git to System git

(I struggled with this for about a day before I figured this out, hopefully it'll save someone the trouble)

Jacob
  • 527
  • 1
  • 5
  • 14