Compiling Git and git-svn on OSX Tiger
December 29th, 2007
Getting Git to work properly with a package manager is pretty easy, but after having been through package version hell I only compile things now.
While compiling is normally an easy configure/make/install cycle, you do get the occasional dependency hell. Unfortunately, Git on Tiger is one such situation.
The following worked for me to get Git, Git’s man pages, and git-svn working on OSX Tiger.
First cd to wherever you keep your source files (remember to adjust this path in all the following instructions if yours is different):
cd /usr/local/src
Next lets install an XML parser dependency, Git, and it’s man pages:
curl -O http://surfnet.dl.sourceforge.net/sourceforge/expat/expat-2.0.1.tar.gz tar xvzf expat-2.0.1.tar.gz cd expat-2.0.1 ./configure --prefix=/usr/local make sudo make install cd.. curl -O http://kernel.org/pub/software/scm/git/git-1.5.3.7.tar.gz tar xvzf git-1.5.3.7.tar.gz cd git-1.5.3.7 ./configure --prefix=/usr/local make sudo make install cd .. curl -O http://www.kernel.org/pub/software/scm/git/git-manpages-1.5.3.7.tar.bz2 sudo tar xjv -C /usr/local/man -f git-manpages-1.5.3.7.tar.bz2
Add the following environment variable to whatever file your shell uses (.bash_profile for BASH):
export MANPATH="/usr/local/man:$MANPATH"
Whew, you now have Git! One cool thing it comes with is git-svn, which let’s you work with existing Subversion repositories. Unfortunately this does not work immediately on Tiger, and you might get an error like Can't locate SVN/Core.pm in @INC when trying to use it. Aw shucks… brave on to use git-svn soon!
First find your existing Subversion source directory, and compile some Perl modules you probably skipped originally:
cd /usr/local/src/subversion-1.4.3 make swig-pl make check-swig-pl sudo make install-swig-pl
At this point you can use git-svn, except when dealing with an authenticated repository. The error will look like this Can't locate Term/ReadKey.pm in @INC, but we can fix that too. We will now connect to Perl’s CPAN (if this is your first time, just answer the questions it asks… I mostly hit enter or typed “yes” for everything) and then install something necessary to take your authentication credentials input from the command line:
perl -MCPAN -e shell install Term::ReadKey exit
Tada, after quite a journey you are ready to start moving away from Subversion with Git and finally achieve branching nirvana! Let me know if you have any problems in the comments.
Many thanks to Justin Reagor and Rudolf Heuser for their tips.

February 17th, 2008 at 2:08 pm
Thanks so much for the help!!! I just wanted to add one more tip on something that tripped me up. Make sure to have swig installed.
February 17th, 2008 at 4:54 pm
[…] problem was getting git-svn to work. Despite the numerous posts including: post1 post2 post3 and post4 I absolutely could not get it to work. Finally, here are two techniques that worked for […]
April 27th, 2008 at 1:30 am
thanks a lot, saved me time
May 28th, 2008 at 4:02 am
Note to add:
to install via fink:
$ sudo fink install git
$ sudo fink install svn-swig-pm586
Thanks for the tip on ’swig-pl’! :) I didnt know what I was looking for.
OS 10.4.11 Tiger
Blaine
June 4th, 2008 at 4:13 am
Awesome! Thanks so much. Saved me a huge amount of pain & time.
June 4th, 2008 at 2:24 pm
Thank you!
June 5th, 2008 at 8:18 pm
Me too–thanks!
[Found you on Google re: “git os x tiger.”]
July 13th, 2008 at 12:39 pm
[…] Compiling Git and git-svn on OSX Tiger […]
July 18th, 2008 at 11:46 pm
[…] Steps I took to install Git on OS X Tiger server are as follows (Thanks to LarrytheLiquid): […]
July 28th, 2008 at 3:11 am
Reliable Git OS X installer packages are available here, if you’d like to skip the hassle and just install git:
http://code.google.com/p/git-osx-installer/
Tim
July 29th, 2008 at 5:09 am
[…] but it is recommend to compile your own from source so you get the latest version. Check out this guide to installing GIT on OS X Tiger. […]
August 6th, 2008 at 3:32 am
Nice!
If you’ve installed git to a non-default location (i.e., use –prefix), you can install the subversion Perl bindings by doing
cd [subversion-source-dir]
cd subversion/bindings/swig/perl/native
perl Makefile.PL PREFIX=/path/to/installation
make
make install
after you’ve built subversion from source.
October 5th, 2008 at 11:15 am
I have bookmarked this informativ site. Thanks Kfz Versicherung
May 28th, 2009 at 1:57 pm
Hi,
this was nice.
thx.
July 12th, 2009 at 8:53 am
[…] Compiling Git and git-svn on OSX Tiger ????????????? Merb ???????????? gem dependency ???? […]
January 1st, 2010 at 4:48 pm
If git and subversion are installed from binary, Perl still needs to find the missing Libraries.
For SVN/Core you may need to extend the Perl5Lib-Variable by putting this into your ~/.profile:
# needed for “git svn”
export PERL5LIB=/opt/subversion/lib/svn-perl/
Thanks for the right pointers!