Git commands not working in Mac terminal: "dyld: Symbol not found: ___strlcpy_chk" error

I needed to install command line tools from Xcode. To do so-

  1. Open Xcode and hit Cmd+,
  2. Click Downloads
  3. Install command line tools.

http://www.hongkiat.com/blog/mountain-lion-git-fix/


Had the same problem. I have OS X 10.8, so XCode was not a solution for me.

Turns out I had a Git version that's not compatible with my OS X version

This info might help(found it googling :) ):

If you are running:

  • 10.6 Snow Leopard: git-2.2.1-intel-universal-snow-leopard
  • 10.7 Lion: git-2.2.1-intel-universal-snow-leopard
  • 10.8 Mountain Lion: git-2.2.1-intel-universal-snow-leopard
  • 10.9 Mavericks: git-2.2.1-intel-universal-mavericks
  • 10.10 Yosemite: git-2.2.1-intel-universal-mavericks

You can download from here: http://sourceforge.net/projects/git-osx-installer/files/


I was also having troubles with the same error. I tried the PATH and .bash_profile tricks (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. Since that library didn't change, I would surmise that it isn't Xcode that is fixing things, but the version of Git that is installed.

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


One can also look at https://stackoverflow.com/a/19457333/894120 and just make a .bash_profile, that worked for me.


The issue is that the git maintainers only support MaxOS10.9 (mavericks). If you have an earlier version, you can't use their distribution.

Recommended by somebody else at work - use (home)brew. Basically with brew installed you can merely use:

brew install git

and it will give you an up to date version. Subsequently to get a new version use:

brew upgrade git

Now brew itself uses git, so it might be that this install is recursive - I had to install it recently for another purpose and it took me several hours - but once you have it there, things should be OK. All I can say is that when I installed brew originally, "git" still referred to the 1.8.x Apple version, and with this change I'm now getting git v2.1.0.