Install git from source on Centos 6

Just want the latest version of git but CentOS 6 doesn’t provide it using yum? Personally I needed this to install the completely awesome GitList

Quick note – If you’re here because you need to just install git you probably just want yum install git!

Before you start on this you should probably know that this will likely interfere with yum if you ever try installing git with yum or rpm.. In that scenario you should probably roll your own RPM and install it with the package manager.. I’ll end up getting round to doing so but for now I’ve not got the time 🙂

Just go ahead and install the requirements with Yum before continuing

yum install perl-ExtUtils-MakeMaker gettext-devel expat-devel curl-devel zlib-devel openssl-devel openssl-devel gcc-c++ make

Then grab the git source, extract it, move it to a nicer directory name, cd to said directory

** wget -O git-source.tar.gz**

tar zxvf git-source.tar.gz

mv git-git* gitsource

cd gitsource

Make it.

make prefix=/usr install

Try it out

git --version

Should be 1.8.2 or whatever the latest version is at the time you’re reading this. Now go on to Install Gitlist! 🙂

_Git logo from Git-SCM.com_

Sign up for emails about the things

Sign up to my (at most) weekly mail list. I'll send general updates to the list, new projects and whatnot. Not every single post as it comes out, but a summary mixed in with random cool tech I find around the net. For more info checkout the subscribe page

I'll never sell, give, transfer, trade your contact details with any other person, company, or other entity and you're free to click that big unsubscribe link at the bottom of each message whenever!