How to use gitolite

If you have not yet set up your ssh access, first see How to set up your ssh access.

Crash course on using gitolite

You can find the upstream documentation for gitolite at their website:

But you probably want to read their user doc section:

The basics however are straightforward. You have been automatically granted a wildcard space under pub/scm/linux/kernel/git/[username]/

To create a repository under there either push to the path you want or perform a git clone. Either of these will create the repository for you.

Example using “git clone”:

git clone[username]/foobar

When cloning a tree that already exists on, you should use the gitolite built in cloning system:

ssh fork pub/scm/from-repo pub/scm/to-repo

This will take care of the git clone, and uses Shared (-s), and Linked (-l) git options.

E.g. for Linux kernel you should start by forking Linus’s repository:

ssh fork \
    pub/scm/linux/kernel/git/torvalds/linux \


No leading “/” or trailing “.git”

  • Do not start repository paths with ‘/’, just “pub/scm”
  • Do not end repository paths with “.git”, just “kernel/git/[username]/linux”

Some commands may be forgiving and work anyway, but many will not.

Additional commands for

Note: This list may be incomplete. You can find out more up-to-date info about available commands if you run:

ssh help


Delete a repository. You will need to run D unlock first, and then D rm. E.g.:

ssh D unlock pub/scm/linux/kernel/git/[username]/linux
ssh D rm pub/scm/linux/kernel/git/[username]/linux


Sets the repository description. E.g.:

ssh desc pub/scm/linux/kernel/git/[username]/linux "[username] kernel tree"


The desc command does not like special characters such as quotes, ampersands, brackets, etc. Another way to set your repository description is via a cgitrc file in the special __meta__ branch of the repo. See Repo appearance on for more details.


Clone a repository that is already hosted by, E.g.:

ssh fork pub/scm/repo1 pub/scm/repo2


Displays a help message for what commands are enabled


Displays access permission you may have to various repos (warning: wall of text).


Sets up a random password you can use to authenticate against in order to send outgoing mail. The command output will also give you some configuration examples for mutt and git.


Allows you to modify your mail forwarding address. See Using your alias for more details.


Allows you to set up your 2-factor authentication token. See 2-factor authentication with gitolite (deprecated) for more details.


Allows you to repoint HEAD to other branches instead of the default. E.g.:

ssh symbolic-ref \
  pub/scm/your/repo HEAD refs/heads/dev


The command is fully compatible with other git-symbolic-ref operations, but only changes to HEAD will be propagated to the public mirrors.


Allows you to set up a remote to another repository hosted at, which is useful when you want to avoid sending a lot of objects during git push. See Setting repo remotes with the “track” command for more details.

Using gitolite instead of public mirrors

The public mirrors, while generally trusted, don’t offer the same level of protection as the gitolite master, so it is advisable to make sure that you use the master to apply pull requests. There is a simple way to instruct git to automatically use the master whenever a pull URL is provided.

Just add the following to your ~/.gitconfig:

[url "ssh://"]
    insteadOf =
    insteadOf =
    insteadOf = git://

Git will now automatically rewrite all requests to be going to the master instead.