From DreamHost
Jump to: navigation, search
DreamHost does not directly support any of the features described on this page and is not responsible for keeping this content updated or accurate. Use at your own risk!
There may be additional information on the talk page.
The instructions provided in this article or section are considered advanced.

You are expected to be knowledgeable in the UNIX shell.
Support for these instructions is not available from DreamHost tech support.
Server changes performed by DreamHost may break your modifications. You, as the user, are responsible for troubleshooting and resolving issues with your customizations.

Git with Gitolite

Git does not come with any access control out of the box. If you know a URL for a git repository, you can clone and commit to it. Gitolite serves to fill in this gap and provide fine grained access control to git repositories.


This guide assumes that you are using a recent version of linux.

Before you begin you will need the following:

  • A user account on Dreamhost dedicated to gitolite.
    • This account will be used to access the git repo and nothing else
    • After installation you will NOT be able to log in normally for this account. Either log in under a different account and the su, or run ssh with the "-o PubkeyAuthentication=no" or "-o preferredauthentications=password" option.
  • SSH installed on your local machine
  • SSH keys generated for your local machine
    • See SSH for more information
    • NOTE: Do NOT add your RSA public key to .ssh/authorized_keys on the server. Use a password to log in. Adding the public key will break things. Just trust us on this.


Below is an overview of these directions.

  1. Copy your public key to the server as "". The name chosen here can be anything, but it will be the name of your git admin.
  2. Log into the server.
  3. Ensure that $HOME/bin is in your path. If it isn't, fiddle with the appropriate rc file for your shell to add it. This snippit will take care of it in bash: echo "export PATH=$HOME/bin:$PATH" >> .bashrc; source .bashrc
  4. Run the following commands, replacing with path of your copied public key file:
   cd $HOME
   git clone git://
   gitolite/install -ln
   gitolite setup -pk

Gitolite is now installed. You can remove the file if desired.


Gitolite administration is NEVER done on the server itself. It is done by cloning the special gitolite-admin repo, making changes, and pushing the changes back to the server.

To clone the gitolite-admin repo:

   git clone

Add Users

  1. Obtain public keys from each user.
  2. Rename each received key file to the name of the user, with a ".pub" at the end.
  3. Copy it into keydir/ in the gitolite-admin repo you cloned.
  4. Commit and push the repo:
   git add keydir
   git commit
   git push

You do NOT need to add users as real (Unix) users. You do NOT add their keys directly anywhere on the server; you do it by cloning, adding keys, and pushing.

Add Repos

  1. Edit conf/gitolite.conf in the gitolite-admin repo.
  2. Add repo paragraphs (example below) and save the file.
  3. Commit and push the gitolite-admin repo
   git add conf/gitolite.conf
   git commit
   git push

You do NOT add the repos directly anywhere on the server; you do it by cloning, adding keys, and pushing.

Example repo paragraph:

   repo foo
       RW+     =   alice
       RW      =   bob