How can I install git on CENTOS 5.5 machine? I tried to install it from yum but got following msg.
root@host [~]# sudo yum install git
Loaded plugins: fastes
I've tried few methods from this question and they all failed on my CentOs, either because of the wrong repos or missing files.
Here is the method which works for me (when installing version 1.7.8):
yum -y install zlib-devel openssl-devel cpio expat-devel gettext-devel
wget http://git-core.googlecode.com/files/git-1.7.8.tar.gz
tar -xzvf ./git-1.7.8.tar.gz
cd ./git-1.7.8
./configure
make
make install
You may want to download a different version from here: http://code.google.com/p/git-core/downloads/list
For installing git
rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
yum install git
I'm sure this question is about to die now that RHEL 5 is nearing end of life, but the answer seems to have gotten a lot simpler now:
sudo yum install epel-release
sudo yum install git
worked for me on a fresh install of CentOS 5.11.
This worked for me on CentOS:
Install dependencies:
yum -y install zlib-devel openssl-devel cpio expat-devel gettext-devel
Get Git
cd /usr/local/src
wget http://code.google.com/p/git-core/downloads/detail?name=git-1.7.8.3.tar.gz
tar xvzf git-1.7.8.3.tar.gz
cd git-1.7.8.3
Build Git
./configure
make
make install
Just:
sudo rpm -Uvh https://archives.fedoraproject.org/pub/archive/epel/5/i386/epel-release-5-4.noarch.rpm
sudo yum install git-core
Just updating this for 2017 and later, as CentOS 5 has reached EOL and the URL for EPEL has changed:
sudo rpm -Uvh http://archives.fedoraproject.org/pub/archive/epel/5/x86_64/epel-release-5-4.noarch.rpm
sudo yum install git
This gets you git 1.8.2.3