Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I can't remember how I installed git a while back....but now it's living in /usr/bin/git and needs to be updated.

I don't care how (pre-compiled or build my own) but what I don't want is another version existing somewhere else. i vaguely remember curl(ing) down the source & compiling it. but not positive. anyway, what's the easiest way to keep Git up-to-date under Mac OS X?

Side question: I'm not that familiar with git. once it's installed is it ENTIRELY contained within its directory? so, in my case, everything about git on my machine (excluding the actual code repositories of course) is in /usr/bin/git/ ? If so then can I just move git around with a simple mv -R /usr/bin/git /opt/git? Then update my $PATH and everything should work as before? if so then i supposed i could just install again by any method and to any directory...and then move the new one into /usr/bin replacing the old version?!? Or is this bad?

share|improve this question
The installed files have paths stored in them. Most of the stored paths can be overridden (using git --exec-path=…, export GIT_EXEC_PATH=…, export GITPERLLIB=…, etc.) but they are probably a few that are not configurable. I would advise against trying to move them around. –  Chris Johnsen Nov 11 '10 at 21:51

3 Answers 3

up vote 8 down vote accepted

There is git-osx-installer. You can subscribe to the feed on that page and get notified about future releases.

share|improve this answer
do you know what directory this installer puts git into? –  Meltemi Nov 12 '10 at 0:12
tried it and it goes into /usr/local/git/bin/git –  Meltemi Nov 12 '10 at 21:14

Perhaps you installed Git from Source on Mac OS X 10.6 (Snow Leopard) Intel x86 (32 bit). Just change the occurrences (in the git-install.bash script) of -arch i386 to -arch x86_64 for a 64-bit install.

share|improve this answer

You may try MacPorts (or Homebrew or Fink) for Mac OS, which is similar to apt-get etc. on linux. It is often better to use a package manager than compiling things by hand as you can update packages with "sudo port update outdated".

I think you can move git around on your hdd as long as the destination is in your path. MacPorts installs to /usr/local/bin, I think. To avoid confusion, you may uninstall/delete your version before installing git via a package manager.

share|improve this answer
I think you mean, package manager. :) –  Xanny Nov 11 '10 at 17:46
Argh, in fact I did. Thanks! –  Purple Tentacle Nov 11 '10 at 17:47
MacPorts installs to the /opt/local tree. –  mipadi Nov 11 '10 at 18:32
Homebrew installs to /usr/local. –  Daniel Beck Nov 11 '10 at 19:32
Moving the installed files around is likely to break things. It could be “fixed” by overriding several of the compiled-in paths, but the solution would be fragile, in my opinion. Using MacPorts (or probably Homebrew) is a fine idea for keeping up to date. It will take MacPorts a while to install Git (the first time) because it will also need to compile and install all its dependencies; I think Homebrew uses many of the system-installed libraries, so it will have less to compile (but risks system updates breaking your compiled software). –  Chris Johnsen Nov 11 '10 at 21:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.