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

prep your home folder

mkdir ~/src
cd ~/src

make 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

run ./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