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-22.214.171.124.tar.gz tar zxvf git-126.96.36.199.tar.gz cd git-188.8.131.52 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-184.108.40.206.tar.gz cd /usr/local/share/man sudo tar zxvf ~/git-manpages-220.127.116.11.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!
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.