So you want to use Git the latest hotness in distributed version control. It builds easily using the instructions in the INSTALL file.
But on Centos 5 (or Red Hat Enterprise Linux 5) there are some dependencies to install first:
sudo apt-get install gettext-devel expat-devel curl-devel zlib-devel openssl-devel
From here the instructions in Git’s INSTALL file work just fine:
wget http://kernel.org/pub/software/scm/git/git-1.5.4.5.tar.gz
tar zxvf git-1.5.4.5.tar.gz
cd git-1.5.4.5
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.
wget http://kernel.org/pub/software/scm/git/git-manpages-1.5.4.5.tar.gz
cd /usr/local/share/man
sudo tar zxvf ~/git-manpages-1.5.4.5.tar.gz
(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!
Postscript
This would of course be easier of using rpm-build. If anybody has experience with a good RPM spec file for git — or using a Fedora Core src rpm — please let us know in the comments.
The good folks at Git also provide pre-compiled RPMs.