Installing Git on cPanel/CentOS ServersMarch 23, 2013
Git is awesome, plain and simple! If you would like to install this on a cPanel and/or a CentOS based server you have 2 options: Installing from and RPM or installing from source.
You should just simply be able to do a yum install on the server and git will e pulled from the “updates” repo:
yum install git
If you run into a dependency issue with perl-Git, check and make sure that perl is not entered into the excludes in /etc/yum.conf. Now one issue with simply pulling from the basic repo is that the version may not be as up to date as possible. On my server I pulled down version 1.7.1, however the latest stable version of git is 1.8.2. You may be able to find much more up to date versions in the EPEL repo or RPMForge. You can also install the latest available version straight from source:
First off, you’ll want to make sure you have any and all dependencies taken care of:
yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
Now lets grab the latest version and git (See what I did there?) to work!!
cd /usr/local/src/ wget https://github.com/git/git/archive/master.tar.gz tar xzf master cd git* make prefix=/usr/local all make prefix=/usr/local install
And thats it! Now feel free to learn git (http://try.github.com) and give it a shot!
root@server [~]# git --version git version 1.8.2.GIT