Install git on Bluehost shared hosting
For developer like me, git and svn or any version control system is a must. And Bluehost does not support git out-of-the-box nor tell you how to install it. But if you have SSH access (if not, request — pretty easy), you can install git with some simple steps.
- You have to specify where to install git. It should be inside your home directory because outside this directory, everything else is read-only. My case is
~/.local
Create that directory and add the following line to.bashrc
inside your home directory. Logout and login again after that.
export PATH=$HOME/.local/bin:$HOME/.local/usr/bin:$PATH
- Make a temporary directory for git source and download git tar ball from kernel.org (latest version is 1.7.3.5, released on 2011-01-05)
cd .local
mkdir -v src
cd src
wget http://kernel.org/pub/software/scm/git/git-1.7.3.5.tar.gz
tar -xzf git-1.7.3.5.tar.gz
- Config and install git
cd git-1.7.3.5
./configure --prefix=$HOME/.local LDFLAGS="-L/lib64"
make
make install
That’s it. Now type git
and you will see it’s working. Pretty easy, right?
usage: git [--version] [--exec-path[=<path>]] [--html-path]
[-p|--paginate|--no-pager] [--no-replace-objects]
[--bare] [--git-dir=</path><path>] [--work-tree=</path><path>]
[-c name=value] [--help]
<command /> [<args>]</args></path>
There are lots of git guide and cheat sheet out the. My favorite cheat sheet is http://cheat.errtheblog.com/s/git
Happy coding!