Active3 years, 6 months ago
Install the Command Line Tools for OS X. Xcode is a nearly 4GB developer suite Apple offers for free from the Mac App Store. However, for the purposes of getting Git and Github setup, you’ll only need a specific set of command line tools which fortunately take up much less space. If you don’t mind the 4GB, by all means go for Xcode.
I've installed the latest version of Git for a data science course according to this site
however when I go to enter the set up commands described on the link (user and email) the shell throws the error:
Raptor36.9k3333 gold badges184184 silver badges309309 bronze badges
![Install Install](/uploads/1/2/5/6/125654138/607579660.png)
Dan SchwartzDan Schwartz
3 Answers
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:
- 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.
- 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'.
hyginnhyginn
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
Ziomek ZiomskiZiomek Ziomski
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♦
João AntónioJoão António
Not the answer you're looking for? Browse other questions tagged git or ask your own question.
Active5 months ago
Does anyone know how to install gitk on Mac?
From their official website, it seems gitk comes with git, but the version of my git (
git version 1.7.12.4 (Apple Git-37)
) does not come with gitk.brew install gitk
does not work for gitk.Version info (copied from comments):
- OS X 10.8.2 (12C2034) 'Mountain Lion'
- XCode Version 4.6 (4H127)
2,84122 gold badges2626 silver badges4343 bronze badges
MingyuMingyu18.9k1111 gold badges4444 silver badges5454 bronze badges
11 Answers
Correct, the 1.7.12.4 (Apple Git-37) does not come with gitk. You can install a more recent version of git which comes with gitk by using brew. More thorough instructions located here: http://www.moncefbelyamani.com/how-to-install-xcode-homebrew-git-rvm-ruby-on-mac/
Run the following commands at the terminal:
If you get an error indicating it could not link git, then you may need to change permissions/owners of the files it mentions.
Once completed, run:
And make sure it shows:
If it does not, run:
And make the path change to put /usr/local/bin earlier in the path. Now, gitk should be on your path (along with an updated version of git).
MarcH12.8k11 gold badge2222 silver badges2222 bronze badges
Jenna PedersonJenna Pederson3,16811 gold badge1313 silver badges1818 bronze badges
I just had the same problem and solved it as follows:
- Download the official git package for Mac from http://git-scm.com/download/mac
- Install the package. This places all the binaries in /usr/local/git/bin.
- Optionally run the included script to make gitk accessible outside of terminals
- Either add /usr/local/git/bin to your PATH or use an alias (
alias gitk='/usr/local/git/bin/gitk'
)
1,61111 gold badge1717 silver badges3737 bronze badges
If you already have git installed via homebrew, you can just do upgrade:
The one at local/bin will have gitk
MarcH12.8k11 gold badge2222 silver badges2222 bronze badges
arisaris12k11 gold badge1919 silver badges2222 bronze badges
I had the same issue. I installed gitx instead.
You can install gitx from here.
Download the package and install it. After that open the gitk from spotlight search, goto the top left corner. Click on GitX and enable the terminal usage.
Goto your repo and simply type:
It will open the Gui.
User manual: http://gitx.frim.nl/user_manual.html
AbhiAbhi1,93011 gold badge2222 silver badges2626 bronze badges
Git Mac version comes without
gitk
but if you do brew install git
you get instant access to gitk
.I'm using MAC sierra 10.12.5
Sebastian Palma18.5k44 gold badges2424 silver badges3838 bronze badges
Lionel MLionel M
There are two ways to fix this:
- Unix Way
- Homebrew Way
1. Unix Way:
Four simple steps
- Execute
which git
in the terminal to know the location of yourgit
executable. Open that directory & locategitk
inside thebin
folder. Copy the path --- typically/usr/local/git/bin
- Create
bash_profile
if you don't have already. Edit your~/.bash_profile
to add the location of localgit
&gitk
in the paths. Or, simply copy-pasta from the sample written below. - NOTE: This step is relevant if you're using El Capitan or higher & if you get an unknown color name “lime” error --- Open the
gitk
file from the location/usr/local/bin/gitk
in a text editor. Find all mentions oflime
in the file, and replace with'#99FF00'
. Take a backup before doing so. - Reload bash:
source ~/.bash_profile
& rungitk
Sample
bash_profile
:2. HomeBrew way
Caution - Most of the steps below probably require
sudo
privileges.brew update
brew doctor
brew link git
- added
/usr/local/Cellar/git/2.4.0/bin
to path & then reload bash & rungitk
- No luck yet? Proceed further.
- Run
which git
& observe if git is still linked to/usr/bin/git
- If yes, then open the directory & locate the was a binary executable.
- Take its backup, may be save with a name git.bak & delete the original file
- Reload the terminal -
source ~/.bash_profile
DDMDDM
What I ended up doing was: brew info git
Which gave me info that git was cloned into: /usr/local/Cellar/git/1.9.0
So I just added: /usr/local/Cellar/git/1.9.0/bin to the beginning of my PATH env variable.
Note: I don't know how to use homebrew... just want to get going quickly as I have other things to do... this basically gets gitk running for me so I'm sticking to it for now. (probably not the way to work with homebrew though).
justinjustin
If you happen to already have Fink installed, this worked for me on Yosemite / OS X 10.10.5:
fink install git
Note that as a side effect, other git commands are also using the newer git version (2.5.1) installed by Fink, rather than the version from Apple (2.3.2), which is still there but preempted by my $PATH.
twmtwm
chrishchrish
First you need to check which version of git you are running, the one installed with brew should be running on /usr/local/bin/git , you can verify this from a terminal using:
In case git shows up on a different directory you need to run this from a terminal to add it to your path:
After that you can close and open again your terminal or just run:
And voila! In case you are running on OSX Mavericks you might need to install XQuartz.
Ronier LopezRonier Lopez
I had the same problem on Mac 10.7.5 with git version 1.7.12.4
When I ran gitk I got an error:
When I looked at the code in gitk I saw the line that sets the version.
This somehow parsed the git version results to
Git-37
instead of 1.7.12.4
I just replaced the git_version line with:
drs2,98522 gold badges2727 silver badges5454 bronze badges
![Git Git](http://cdn.instructables.com/FAT/P8UE/I6AVR7PS/FATP8UEI6AVR7PS.MEDIUM.jpg)
user3258072user3258072