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?
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).
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.
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 .
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
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
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/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With