12

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?

1
  • 1
    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. Nov 11, 2010 at 21:51

3 Answers 3

8

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

2
  • do you know what directory this installer puts git into?
    – Meltemi
    Nov 12, 2010 at 0:12
  • tried it and it goes into /usr/local/git/bin/git
    – Meltemi
    Nov 12, 2010 at 21:14
1

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.

5
  • I think you mean, package manager. :)
    – JustXanny
    Nov 11, 2010 at 17:46
  • 1
    MacPorts installs to the /opt/local tree.
    – mipadi
    Nov 11, 2010 at 18:32
  • 1
    Homebrew installs to /usr/local.
    – Daniel Beck
    Nov 11, 2010 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). Nov 11, 2010 at 21:57
  • hmmm. so how did i get mine installed into /usr/bin? would like to find that installer (or instructions) again so i can just update that version... damn, i really should take notes of every install i do..there's just WAY to many versions of the same thing in the UNIX world...
    – Meltemi
    Nov 12, 2010 at 0:08
0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .