How to install git on Red Hat Linux / Cent OS


Git is dependent on the follow libraries, make sure they are installed.

Code:
yum install zlib-devel
yum install openssl-devel
yum install perl
yum install cpio
yum install expat-devel
yum install gettext-devel

Curl will need to be installed from source. The current version from Red Hat/Cent OS doesn’t work correctly with Git.

Code:
wget http://curl.haxx.se/download/curl-7.18.0.tar.gz
tar xzvf curl-7.18.0.tar.gz
cd curl-7.18.0
./configure
make
make install

Next, make sure /usr/local/lib is in your ld.so.conf, this is required for git-http-push to correctly link up to the Curl version you are installing.

Code:
vi /etc/ld.so.conf

(Insert the following)
/usr/local/lib

Save the file, then run:
ldconfig

Now download and install Git

Code:
wget http://www.codemonkey.org.uk/projects/git-snapshots/git/git-latest.tar.gz
tar xzvf git-latest.tar.gz
cd git-date
autoconf
./configure --with-curl=/usr/local
make
make install

Comments are closed.