We have a server that has cPanel to help manage the server. cPanel was being rather stubborn when attempting to install GIT. It was down to cPanel scripts that rely on the same dependencies that GIT wan’t to change when attempting to install through “yum install git”. In version 11.36 they introduced GIT in the default package. The executable to GIT can be found here: /usr/local/cpanel/3rdparty/bin/git. Now you don’t want to be typing out that long executable path every time you want to do a GIT operation. To do this you need to add /usr/local/cpanel/3rdparty/bin/git as a global alias

cPanel enable use of GIT

Edit the global bashrc file so users can access git by command “git” by opening /etc/bashrc in a text editor of your choice. At the bottom of the file paste the following:

# cPanel GIT
alias git='/usr/local/cpanel/3rdparty/bin/git'

After editing the bash file you can reload it so it recognises the new alias or restart your SSH session.

source ~/.bashrc