It’s a strange thing that such a popular software is not yet included into Directadmin custombuild, but you are always welcome to install it by yourself. Let me start this brief tutorial about git installation.
If you need a quick solution, you can use yum:
yum install git
But this will allow you to install version 1.7, that is quite outdated (though fully functional). If you want to have the most current version, you will have to perform some more steps. :) Here they are:
First of all, let’s install some server software that is required for running git:
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
Then we’ll need the most current version (2.7.1 at the moment, you can check it here).
Let’s unpack and continue:
tar xzvf git-2.7.1.tar.gz
Proceeding to further configuration:
make prefix=/usr/local/git all
You might receive an error message about libiconv (utf8.c:463: undefined reference to `libiconv’):
In this case, we’ll need to omit iconv (I don’t think we’ll need it):
make prefix=/usr/local/git all CFLAGS=-liconv
make prefix=/usr/local/git install
Same thing – if you got the error message about iconv on a previous stage, you need to input
make prefix=/usr/local/git install CFLAGS=-liconv
Ok, we’re almost done. Let’s export the path:
echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc
That’s it! Let’s check git version:
You should see something like
Now you’re welcome to use it as you like. :)
Great tutorial, thanks for posting!
If you get notices like this:
git: /usr/local/lib/libz.so.1: no version information available (required by git)
rm /usr/local/lib/libz.so.1 && ln -s /usr/lib/libz.so.1.2.3 /usr/local/lib/libz.so.1
Thanks for posting this tutorial!
However it’s worth mentioning that if you want to have the most recent version and therefore opt for the second option you describe (which is compiling from source) you shouldn’t do this as root as the screenshots seem to imply.
Compiling from source might lead to serious security issues and is in general a bad idea.