Create a repository

To create a repository, first check out the gitolite-admin repository as a client.

$ git clone gitolite@server:gitolite-admin

Append a new repository to gitolite-admin/conf/gitolite.conf:

repo repository_name
RW+ = @all

Commit and push the changes and gitolite will automatically generate the necessary files on the server.

Adding http(s) access via Apache (with basic authentication)

We need to create an suEXEC wrapper script. To satisfy suEXEC's security requirements, the script and the directory containing it must be owned by gitolite:gitolite and below /srv/http in the directory hierarchy. For this example, we create the directory as /srv/http/git/cgi-bin.

# install -o gitolite -g gitolite -d /srv/http/git/cgi-bin

Create an suEXEC wrapper for the gitolite shell with the contents below. For this example, we create it as /srv/http/git/cgi-bin/gitolite-suexec-wrapper.

Finally, in the gitolite-admin repository you cloned in the previous section, edit conf/gitolite.conf, add an R = daemon access rule to all repositories you want to make available via http, and push the changes.

Add users

ssh users

Ask each user who will get access to send you an SSH public key. Rename each public key to username.pub, where username is the user name which will be used in gitolite.conf. Then move all new public keys to the keydir directory in the cloned gitolite-admin repo. You can also organise them into various subdirectories of keydir if you wish, since the entire tree is searched.