Error message

Deprecated function: Methods with the same name as their class will not be constructors in a future version of PHP; GeSHi has a deprecated constructor in require_once() (line 915 of /var/www/

A simple method for using shared webhosting like Dreamhost to store git repositories

I wanted to set up some personal git repositories and don't want to pay the fee to or another service to host the repository.  Fortunately it's possible to set up a repository behind any SSH account, such as on my web hosting account.  I've just gone through setting up a git repository on my Dreamhost account, and it is pretty straight-forward, but the steps are different from what's shown at the GIT book on

The first step is to set up passwordless SSH access to your web hosting account or other SSH login.  The instructions at are pretty accurate in how to do this.  They're suggesting to set up a new account, named git, to store the repositories but I don't think that's necessary.  However, if the repository is to be shared between multiple people it should be set up on its own SSH login.

I created a directory 'git' in the home directory of my hosting account.  That directory is being used to store repositories.  Repositories are created as follows.

$ mkdir git
$ cd git
$ mkdir repository.git
$ cd repository.git
$ git --bare init

So far the steps are as shown on  From here onward is where my steps differ from theirs.

On your laptop, type this:

$ git clone

This creates a directory named 'repository' containing a clone of the empty repository just created above.

Now add files to the repository, for example:

$ cd repository
$ echo 'Hello, world!' >
$ git add
$ git commit -m 'initial commit'
$ git push