Install Git from source on CentOS 5.x

The simplest way to install Git is from the EPEL repository. You can add the EPEL repository by following my previous post on this subject: Adding the EPEL repository to CentOS 5.x.

But if you need, for some reason, to install Git from source, then you'll have to follow these instructions

Upgrade the system

It's always a good thing to have the latest packages:

yum -y upgrade

Install the needed packages for compilation

yum install gcc zlib-devel curl-devel

You'll need zlib-devel if you want to use http/https/webdav access to Git repositories.

Build Git from source

Download the sources and untar:

wget http://git-core.googlecode.com/files/git-1.7.8.4.tar.gz
tar xvzf git-1.7.8.4.tar.gz

Configure and set the prefix, if you want something more exotic. And in the last step, build the thing:

./configure --prefix=/usr/
make
make install

That's all!

Add new comment