How to Install Git on your server

A quick tutorial on installing Git on your server in order to download packages directly from github like Node.js.

First make sure you don’t have Git already installed.

git --help

If something other than an error pops up in the command line, then you already have it installed! Otherwise read on…

Installation…

(Keep in mind, I’m writing this tutorial for people using CentOS distros and other red hat based operating systems. This means I have no package installer like yum or apt-get)

Change to the temporary directory on your server where you wish to install something. Log in as root and…

cd /var/tmp

Now download the file…

wget http://kernel.org/pub/software/scm/git/git-1.7.4.4.tar.gz

Now unpack it…

tar -zxf git-1.7.4.4.tar.gz

Change to the new directory…

cd git-1.7.4.4

Configure for installation…

./configure

Make the install…

make

Install Git…

make install

Now test to make sure it installed properly…

git --help

If everything goes according to plan, you should now see something like the screenshot below appear.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.