Compiling Git for Mac OS X 10.4.10 (Intel) 2

Posted by Justin Reagor Sun, 26 Aug 2007 04:13:00 GMT

Update: Checkout the Leopard version of this OS X Git howto

The following is a step-by-step, dependency chain installation guide to getting up and running with Git on OS X.

Only one required version number was needed, docbook-xml v4.2, otherwise you can use the latest versions of the packages you will be installing, including Git (please note newer version of the below packages may require other dependencies).

You may have wget installed already, though this guide includes wget as it is not natively included in Mac OS X. This was needed to pull down docbook-xml 4.2 from the original wiki article I followed, noted at the bottom of this article.

The following tarballs were used for my installation, in alphabetical order…

asciidoc-8.2.2.tar.gz
docbook-xsl-1.73.1.tar.gz
expat-2.0.1.tar.gz
getopt-1.1.4.tar.gz
gettext-0.16.1.tar.gz
git-1.5.2.5.tar.gz
wget-1.10.2.tar.gz
xmlto-0.0.18.tar.bz2

1. Download and install expat; dead simple configure/make/make check/sudo make install

2. Download and install asciidoc; sudo ./install.sh (requires python >=2.3)

Test asciidoc by:
  • rm doc/asciidoc.html
  • asciidoc doc/asciidoc.txt
  • Should re-generate doc/asciidoc.html

3. Download and install gettext; simple configure/make/make check/sudo make install

4. Download and install getopt;
  • Change root Makefile LDFLAGS=-lintl
  • make/sudo make install

5. Download and install wget; dead simple configure/make/sudo make install

6. Tricky part… installing xmlto (I used docbook-xsl v1.73.1, docbook-xml 4.2 was required by xmlto)
  • sudo mkdir /etc/xml
  • sudo xmlcatalog—noout—create /etc/xml/catalog
  • Download and unpack docbook-xsl
  • sudo mkdir -p /usr/local/share/docbook/xsl
  • mv ./docbook-xsl-1.73.1/ /usr/local/share/docbook/xsl/1.73.1
  • sudo xmlcatalog—noout \
    —add ‘nextCatalog’ ’’ ‘file:///usr/local/share/docbook/xsl/1.73.1/catalog.xml’ \
    —create /etc/xml/catalog
  • sudo mkdir -p /usr/local/share/docbook/xml
  • cd /usr/local/share/docbook/xml
  • sudo wget -r -np -nH -l 0—cut-dirs=2 http://www.oasis-open.org/docbook/xml/4.2
  • sudo xmlcatalog—noout \
    —add ‘nextCatalog’ ’’ ‘file:///usr/local/share/docbook/xml/4.2/catalog.xml’ \
    —create /etc/xml/catalog
  • Download and install xmlto; simple configure/make/sudo make install
7. Download and install git source…
  • make prefix=/usr/local all doc
  • make prefix=/usr/local test
  • sudo make prefix=/usr/local install install-doc
8. Test the installation of Git on your system by…
  • rails some_stupid_demo && cd some_stupid_demo
  • git-init
  • git-add .
  • git-commit -m ‘This is the beginning of a beautiful friendship’

http://wincent.com/knowledge-base/Installing_Git_1.5.2.3_on_Mac_OS_X_Tiger Taken from above url, but shortened (with some small modifications) from the trial-and-error description above.

A helpful start to using Git for Rails development can be found by the great guys over in the UK at New Bamboo… http://blog.nbwd.co.uk/2007/8/16/using-git-for-rails-development I’ve found this to be an excellent guide, as it includes git-svn for SCM with Git using current SVN repo’s.

Everday Git can be found here… http://www.kernel.org/pub/software/scm/git/docs/everyday.html