Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing git on a cPanel server

Tags:

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?

like image 327
Ali Samii Avatar asked Aug 29 '13 18:08

Ali Samii


People also ask

Does cPanel have Git?

Overview. The Git™ Version Control feature allows you to easily host Git repositories on your cPanel account. You can use Git to maintain any set of files (for example, a website's files and assets, a software development project, or simple text files).

How do I deploy Github to cPanel?

To pull the changes from the remote repository and then manually deploy them, perform the following steps: Navigate to cPanel's Git Version Control interface (cPanel >> Home >> Files >> Git Version Control). Locate the desired repository in the list of repositories and click Manage. Click the Pull or Deploy tab.

How do I manually install Git?

To install Git, navigate to your command prompt shell and run the following command: sudo dnf install git-all . Once the command output has completed, you can verify the installation by typing: git version .


3 Answers

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

like image 116
TheCyberXP Avatar answered Nov 17 '22 21:11

TheCyberXP


cPanel disables Perl updates to protect its own binaries, which are git dependencies.

Just run yum with the following lines.

sudo yum install git --disableexcludes=main --skip-broken
like image 25
Carlos Troncoso Avatar answered Nov 17 '22 21:11

Carlos Troncoso


Remember if you are updating the bashrc file to reload this so you dont have to restart your SSH session by using:

source ~/.bashrc

http://www.codefuel.co.uk/cpanel-git-resolved/

like image 25
Rees McIvor Avatar answered Nov 17 '22 22:11

Rees McIvor