Git on a Shared Host, 10 Minute Install Guide
I’ve recently started using Git for local work and personal projects. So far it’s great. It’s small, fast, and extremely robust. The cheap branching and merging are certainly worth the small change in workflow you’re forced to make as a result of using a distributed scm.
One problem that I have run into is that not all hosts have Git available and you can’t go and install it in /bin on a shared host you don’t own. Luckily, this isn’t a problem. This is a quick and dirty guide to getting Git running on a shared host. Note that these instructions apply equally well for replacing the system version of Git with your own (but the version you install will be visible to you only).
Downloading the Git Source and Man Pages
The latest Git source is posted on the Git homepage. At the time of this writing the current version is 1.6.2.2. You can download the tarballs wherever you like. They are used for setting up the installation and are not the final destination point for any content.
% mkdir ~/downloads
% cd ~/downloads
% curl -O http://kernel.org/pub/software/scm/git/git-1.6.2.2.tar.gz% curl -O http://kernel.org/pub/software/scm/git/git-manpages-1.6.2.2.tar.gz
Installing Git
To install Git just unpack the tarball and make it. Just remember to pass in a custom root for the installation using the –prefix option (that’s a dash-dash).
% tar xzvf git-1.6.2.2.tar.gz
% cd git-1.6.2.2
% ./configure –prefix=$HOME
% make && make install
The above installation sequence will install the git libs and binaries to ~/lib and ~/bin, respectively. All you need to do is make sure that ~/bin is on your $PATH. It makes sense to do this in your shell’s env file (e.g. .zshenv).
% export PATH=~/bin:$PATH
That’s all there is to it. On to the man pages.
Installing the Git Man Pages
Installing the man pages is a little different since its textual content that doesn’t require anything to be compiled. You just need to unpack the tarball and make sure man knows where to find the content.
It’s customary to put user manpages in ~/share/man so we’ll do the same.
% cd ~/share/man
% tar xzvf ~/downloads/git-manpages-1.6.2.2.tar.gz
As was the case with the binaries, we need to do set a path. Here it’s the MANPATH.
% export MANPATH=~/share:$MANPATH
Done. Elapsed time 8 minutes.
0 Comments to “Git on a Shared Host, 10 Minute Install Guide”
No Comments. Send your comment.
Leave a Reply