Installing git on a cPanel server

Ali Samii picture Ali Samii · Aug 29, 2013 · Viewed 25.4k times · Source

I need to install git on cPanel but I am finding a lot of information indicating that this is not a simple process.

I have a cPanel/WHM instance on a CentOS distribution and am trying to install git without breaking cPanel. The information I have found says that installing git can break cPanel because of the Perl dependencies.

This page on cPanel's forums advises against installing git:

http://forums.cpanel.net/f391/installing-git-294411.html

However, this page under the cPanel Features says that an RMP has been released for git:

http://features.cpanel.net/responses/possibility-to-install-git-on-cpanel-server-without-breaking-it

I requested support from cPanel and was given this response:

We actually do not recommend the installation of GIT unless you are very experienced with it's install due to it having the possibility of breaking perl.

We do distribute the git RPM as a convenience during install, however, it's not setup or supported - it's only added as a convenience and requires manual install of further packages and configuration.

The RPM we provide for git installs the binary to /usr/local/cpanel/3rdparty/bin so you will need to run it out of here. It's not the full tool set, so anything outside of this would need to be installed by the systems administrator.

Does anyone have advice on how best to install git on cPanel such that all cPanel user accounts will be able to use git, make sure that the installation doesn't break Perl, and what is missing in the RPM provided by cPanel based on the statement in the last paragraph quoted above?

Answer

TheCyberXP picture TheCyberXP · Aug 30, 2013

I figured out the same problem, but I find out that from the WHM/Cpanel version 11.36+ Git is installed by default in the system and available for all the account.

You have just to create a Git's account (be sure to add remote ssh access) then in your .bashrc you add just this alias

alias git="/usr/local/cpanel/3rdparty/bin/git"

then if you type git in the user's shell, it should just work automagically ;)

Cheers