These are the Terminal commands I recently used (Feb 2013) to install Git 1.8.1.2 from source on CentOS 6.3. I ran this in a VirtualBox VM after a fresh install from the ISO.
You mileage will vary as the yum packages are updated over time. The yum install
line below should include all the dependencies, at least it did for me. Eventually yum install git
will include 1.8.x but until then I hope this helps.
cd ~/Downloads
su
yum -y install zlib-devel openssl-devel cpio expat-devel gettext-devel curl-devel perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker
exit
wget -O v1.8.1.2.tar.gz https://github.com/git/git/archive/v1.8.1.2.tar.gz
tar -xzvf ./v1.8.1.2.tar.gz
cd git-1.8.1.2/
su
make prefix=/usr/local all
make prefix=/usr/local install
exit
October 2013 update: Install Git 1.8.4.1 from source on CentOS 6.4
Thanks!
It was nice to find a dependency list like this. :)