administering and running gitolite

Note: some of the paths in this document use variable names. Just refer to ~/.gitolite.rc for the correct values for your installation.

In this document:

administer

First of all, do NOT add new repos manually, unless you know how to add the required hook as well. Without the hook, branch-level access control will not work for that repo, which sorta defeats the idea of using gitolite :-)

Please read on to see how to do this correctly.

adding users and repos

specifying gitweb and daemon access

This is a feature that I personally do not use (corporate environments don't like unauthenticated access of any kind to any repo!), but someone wanted it, so here goes.

To make a repo or repo group accessible via "git daemon", just give read permission to the special user "daemon". See the faq, tips, etc document for easy ways to specify access for multiple repositories.

There's a special user called "gitweb" also, which works the same way. However, setting a description for the project also enables gitweb permissions so you may as well use that method and kill two birds with one stone, like so:

gitolite = "fast, secure, access control for git in a corporate environment"

You can also specify an owner for gitweb to show, if you like:

gitolite "Sitaram Chamarty" = "fast, secure, access control for git in a corporate environment"

Note that gitolite does not install or configure gitweb/daemon -- that is a one-time setup you must do separately. All this does is:

The "compile" script will keep these files consistent with the config settings -- this includes removing such settings/files if you remove "read" permissions for the special usernames or remove the description line.

custom hooks

If you want to put in your own, custom, hooks every time a new repo is created by gitolite, put a tested hook script in src/hooks. As distributed, the only file there is the update hook, but everything (everything) in that directory will get copied to the hooks/ subdirectory of every new repo created.

In order to push a new or updated hook script to existing repos as well, just run easy install once again; it'll do it to existing repos also.

VERY IMPORTANT SECURITY NOTE: the update hook in src/hooks is what implements all the branch-level permissions in gitolite. If you fiddle with the hooks directory, please make sure you do not mess with this file accidentally, or all your fancy per-branch permissions will stop working.

custom git config

The custom hooks feature is a blunt instrument -- all repos get the hook you specified and will run it. In order to make it a little more fine-grained, you could set your hooks to only work if a certain "gitconfig" variable was set. Which means we now need a way to specify "git config" settings on a per repository basis.

Thanks to Teemu (teemu dot matilainen at iki dot fi), gitolite now does this very easily. For security reasons, this can only be done from the master config file (i.e., if you're using delegation, the delegated admins cannot specify git config settings).

Please see conf/example.conf for syntax. Note that this only supports the basic forms of the "git config" command:

git config              section.key value   # value may be an empty string
git config --unset-all  section.key

It does not (currently) support other options like --add, the value_regex, etc.