Skip to content

Instantly share code, notes, and snippets.

@matthewriley
Last active July 19, 2016 10:24
Show Gist options
  • Save matthewriley/8319432 to your computer and use it in GitHub Desktop.
Save matthewriley/8319432 to your computer and use it in GitHub Desktop.
Install Git 1.8.5.2 from source on CentOS 6.5

Install Git 1.8.5.2 from source on CentOS 6.5

These are the Terminal commands I recently used (January 2014) to install Git 1.8.5.2 from source on CentOS 6.5. I ran this in a VirtualBox VM after a fresh install from the ISO.

If you are not running in a VirtualBox VM, you will need to run the following first:

su
yum -y install gcc make
exit

Your 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. Depending upon how often you use yum update you may need to run yum --enablerepo=base clean metadata as su before you run the following commands.

cd ~/Downloads
su
yum -y install zlib-devel openssl-devel cpio expat-devel gettext-devel curl-devel perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker
wget -O v1.8.5.2.tar.gz https://github.com/git/git/archive/v1.8.5.2.tar.gz
tar -xzvf ./v1.8.5.2.tar.gz
cd git-1.8.5.2/
make prefix=/usr/local all
make prefix=/usr/local install
exit

At this point you can safely remove the git tar file and git directory from your Downloads directory. Git should now be configured according to the following:

$ which git
/usr/local/bin/git

$ git --version
git version 1.8.5.2
@simon-p-r
Copy link

Thanks Matt however it doesn't add Git to you path on an AWS EC2 instance of CentOS 6.5!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment