Installing Git on a Shared Host

Git is a fantastic tool and is very useful for deployment. If you can't install git system wide or don't want to mess with installing it on the entire system here is an easy way to install it for a single user. This also works well on Mac OS X where installing git is more challenging than necessary. Script included

I used this script to install git on 1and1. The same script should work anywhere with no or little modification.

Preparation

Goto http://git-scm.com/download and get the link to the latest git release.

Script

You should be able to just copy and paste this (replacing the link with the one from git-scm.com)

  1. mkdir git-download
  2. mkdir -p $HOME/bin/git
  3. cd git-download
  4. wget http://kernel.org/pub/software/scm/git/git-1.6.5.tar.gz # replace with your link
  5. tar -xzf git-1.*.tar.gz
  6. cd git*
  7. ./configure --prefix=$HOME/bin/gitlib
  8. make
  9. make install
  10. echo 'PATH=$PATH:$HOME/bin/gitlib/bin/' > ~/.bash_profile
  11. echo 'export PATH=$PATH:$HOME/bin/gitlib/bin:$HOME/bin/gitlib/libexec/git-core' > ~/.bashrc
  12. PATH=$PATH:$HOME/bin/gitlib/bin
Reblog this post [with Zemanta]

Post new comment

The content of this field is kept private and will not be shown publicly.