2

I've installed the latest version of Git for a data science course according to this site

https://help.github.com/articles/set-up-git

however when I go to enter the set up commands described on the link (user and email) the shell throws the error:

Daniels-MacBook-Pro:~ das2890$ git config --global user.name "Daniel Schwartz"
Illegal instruction: 4
Raptor
  • 53,206
  • 45
  • 230
  • 366
Dan Schwartz
  • 31
  • 1
  • 3
  • 2
    possible duplicate of [What is the "Illegal Instruction: 4" error and why does "-mmacosx-version-min=10.x" fix it?](http://stackoverflow.com/questions/14268887/what-is-the-illegal-instruction-4-error-and-why-does-mmacosx-version-min-10) – Code-Apprentice Jun 14 '14 at 00:51
  • In particular, see this answer: http://stackoverflow.com/a/14269066/1440565 – Code-Apprentice Jun 14 '14 at 00:51

3 Answers3

4

To update the options as of Feb. 2016: You can get older git versions from official sources but you will need to compile them yourself. In order to compile them, you need Xcode installed. But if you have Xcode installed, in principle you also have git anyway. Here's how:

  1. For Mac OS 10.7.5 you need Xcode 4.6.3:

    1.1 Go to developer.apple.com and register for a developer account.

    1.2 Log in, go to developer.apple.com/index.action# and search for "xcode 4"

    1.3 Find xcode 4.6.3 and download the .dmg (1.72GB); install it and open the program. It will take some time to configure itself.

    1.4 Accept the terms and conditions.

  2. That does not yet install the command line tools: gcc, make and ... git. You need to install these separately. Normally you should have been able to open Xcode, choose preferences ... downloads, and install the command line tools from the Xcode GUI. But by now, the tools' certificate has expired and the Install will abort. You'll need to download the .dmg as above.

    2.1 Go to developer.apple.com/index.action# and search for "command line tools".

    2.2 Find "Command Line Tools (OS X Lion) for X-code April 2013" and download the .dmg (140 MB); open it and install the packages.

    2.3 To confirm, open a terminal and type "which git" - the path to the executable should be shown; then "git --version" should give you: "git version 1.17.12.4".

hyginn
  • 301
  • 3
  • 9
  • 1
    All works as above for me, except the link for downloading the command line tools is now https://developer.apple.com/download/more/ – mahi-man May 01 '18 at 21:15
1

It is probably due to the git version you installed and your mac os version does not support it, try downgrading your git version: have a look at possible version downloads: enter link description here

I recomend git version 1.8.4.2

0

The error is due to the use of a incompatible git version, which uses features only available to newer OS versions.

To solve it you can do one of these:

  • upgrade your OS version

  • compile git for your OS version what-is-the-illegal-instruction...

  • run a older git version, as Ziomek mentions

  • use brew for picking and installing the correct git version

Community
  • 1
  • 1