Tuesday, February 24, 2009

How to install git on Mac OS X 10.4 (Tiger)

I'm finding myself using my old iBook whilst my MacBook Pro is being repaired. Since I'm taking a git class at RubyLearning.org, I need to install git again. The problem is that the git-osx-installer only works for Leopard (10.5), and my old iBook is running 10.4. This means I have to build and install it myself. There are a few similar articles out there on how to do this. Here are my notes.
  1. I first downloaded Xcode 2.5 Developer Tools from http://connect.apple.com. It's free to join Apple Developer Connection, though it is a limited account. However, you will be able to download Xcode. Be sure to get version 2.5 as it is for OS X 10.4 (Tiger).
  2. Next we need to install expat which is a dependency for git. I dowloaded expat-2.0.1.tar.gz from SourceForge. Building and installing expat with the C compiler tools is done in three steps: configure, make, make install. I downloaded all of the source tarballs to my /usr/local/src directory. Adjust as necessary if you use a different directory. Also, use sudo where necessary.
    cd /usr/local/src
    tar xvzf expat-2.0.1.tar.gz
    cd expat-2.0.1
    ./configure --prefix=/usr/local
    make
    sudo make install
  3. Now we can install git. I downloaded git-1.5.6.tar.gz and git-manpages-1.5.6.tar.bz2 from kernel.org. I originally tried version 1.6.1 but it gave specific incompatibility errors for darwin ppc. So, I went back to version 1.5.6 and had better success. Again, building and installing git is done with configure, make, make install.
    cd /usr/local/src
    tar xvzf git-1.5.6.tar.gz
    cd git-1.5.6
    ./configure --prefix=/usr/local
    make
    sudo make install
  4. The last, optional step, is installing the man pages for git.
    cd /usr/local/src
    tar xjv -C /usr/local/man -f git-manpages-1.5.6.tar.bz2
  5. Then add the following to your profile (e.g., ~/.bash_profile): export MANPATH="/usr/local/man:$MANPATH"
  6. Also make sure you have /usr/local/bin. in your PATH.
  7. Open a new terminal shell and test the man pages: man git
  8. Also test you have git installed and it is found in your PATH: git --version

12 comments:

Vlad Sanchez said...

Dont how it worked for you.

It didnt for me.

I did the whole thing about updating expat and asciidoc. Then D/L'd the Git tar and followed your instructions on making it. But it didnt work.

It really seems that I might not run Git on the 10.4 laptop. I'll keep you posted about my progress.

Cynthia Sadler said...

What was the error? Was it permissions? Maybe you could try sudo before each command?

Marius Amado-Alves said...

Doesn't work here.
Make fails.
/usr/bin/ld: unknown flag: -compatibility_version
collect2: ld returned 1 exit status
make: *** [libexpat.la] Error 1

Cynthia Sadler said...

Hmmm, I don't know about the -compatibility_version error. Haven't seen that one. Hope you figure it out. Might need to update OS X 10.4, make sure your libraries are up-to-date.

Irene Moon said...

thanks very much for blogging these instructions! worked perfectly for me using 10.4

Anonymous said...

Worked fine with the latest version of 1.6.3

Aaron Renner said...

Thanks, worked great. Used 1.5.6.6 on OS X 10.4.11.

Casey said...

I wonder if there are any hardcore PPC fans that use git and would produce PPC binaries? I know if I had the time and experience with git I would do it in a heartbeat.

Benjamin Parry said...

This is far the most straight forward and accurate tut I've found.

Here! I award you Kudos, many many Kudos, just promise you won't spend them all at once?!?

Thanks

Bruce Martin said...

Following these instructions worked for me, Although I installed the latest version 1.8.1.3 I downloaded the source from git at this URL: http://code.google.com/p/git-core/downloads/list

Thanks!

DasHeff said...
This comment has been removed by the author.
DasHeff said...
This comment has been removed by the author.