Install Git in your home directory :: How to

If you every need to install Git on a server but don’t have root access, follow the below steps to install Git in your home directory<

Check that you can run gcc – if you get errors then you got to figure something else out

gcc --version

Pprep your home folder

mkdir ~/src
cd ~/src

Mmake the ~/opt directory – this is where we will install git into

mkdir ~/opt

Get the git source from google code 1.7.8.4 is the latest at the moment and untar

wget http://git-core.googlecode.com/files/git-1.7.8.4.tar.gz
tar -xvzf git-1.7.8.4.tar.gz
cd git-1.7.8.4

Rrun ./configure and tell it to use ~/opt

./configure --prefix=$HOME/opt

Now do the install

make install

Check git is happy

~/opt/bin/git --version

If it prints out ‘git version 1.7.8.4’ then its all good to go – git is now installed in your home folder

Justin Kelly

Justin Kelly

Web Developer, Business Analytics, Data Engineer specialising in PHP, ReactJS, Tableau, AWS RedShift and Matillion ETL

Based in Melbourne, Australia

Feel free to contact me justin@kelly.org.au or _justin_kelly

Leave a comment

Name Notify me of replies by email.