- Fink packages an almost up-to-date version, named simply
- MacPorts packages an up-to-date version as
Either of these methods, though, installs lots of dependencies. Which requires lots of compile time. And lots of disk space – especially for the MacPorts version.
So I prefer to compile Git myself – and use Fink for dependencies. Here’s how I do it.
Install Fink by following Fink’s installation instructions.
fink install gettext-tools expat1-shlibs
From here the instructions in Git’s INSTALL file work just fine:
curl -O http://kernel.org/pub/software/scm/git/git-126.96.36.199.tar.gz tar zxf git-188.8.131.52.tar.gz cd git-184.108.40.206 make prefix=/usr/local all sudo make prefix=/usr/local install
Now for the manpages.
Rather than build the docs ourselves (which requires asciidoc and a host of dependencies), I prefer to download them precompiled from Git and manually copy them into /usr/local/share/man.
curl -O http://kernel.org/pub/software/scm/git/git-manpages-220.127.116.11.tar.gz sudo tar zxf git-manpages-18.104.22.168.tar.gz -C /usr/local/share/man
(Replace the version numbers here with what’s right for the version of Git you’re installing.)
Now we’re ready to try this out, we’ll ask what version we just installed, then show the manpage:
git --version man git
Done. Happy versioning!
Sean Santry has an even simpler way to avoid the gettext-tools dependency – by telling make that we don’t have msgfmt at all.
NO_MSGFMT=yes make prefix=/usr/local all sudo make prefix=/usr/local install
Using this tip you can build Git without Fink altogether!
2 Comments on the Original Post
You can also just install a complete OS X package from http://code.google.com/p/git-osx-installer/ It’s only 3.6MB and spares you the manual install
–Pieter de Bie 4 Apr 2008, 10:31 AM
That’s great, Pieter — thanks for the link to a pre-compiled installer for OS X. And these instructions for building your own package look good, too.
– Eric Johnson 4 Apr 2008, 12:59 PM