Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am running a Debian system, and have recently installed gitolite using the DEB package.

Here is my problem:

I have tried to clone the gitolite-admin.git repository (which is used for configuring the gitolite installation for all repositories that are you wish gitolite to manage for you).

My first attempt was exactly how the instructions state:

git clone gitolite@server:gitolite-admin

I received the following error:

fatal: 'gitolite-admin' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

Note: This same thing happens if I replace gitolite-admin with gitolite-admin.git
HOWEVER, when I do the following:

git clone gitolite@server:~/repositories/gitolite-admin.git

This line successfully clones the repository to my local workstation.
Now, I have no problem adding the extra text to the filepath, however I am told that this is incorrect by the documentation.

The following link ( ) states that "adding repositories/ at the start of the repo name in the git clone" is a common error/mistake. It also states that "In fact gitolite prepends $REPO_BASE internally, so you shouldn't also do the same thing!"

My .gitolite.rc file contains the following line for $REPO_BASE:

[Located in /home/gitolite/.gitolite.rc]

My question is, what is wrong with my configuration, that causes the $REPO_BASE not to prepend my git clone?

If you need any further information, please leave a comment stating what info you need and I will be happy to oblige.

Other notes:

  • git version:
  • gitolite version: 1.5.4-2~bp (this is from lenny-backports, because I am using Debian Lenny and gitolite does not come standard with Lenny)
  • Debian's installation creates the user "gitolite" to manage gitolite repos with.
share|improve this question
up vote 6 down vote accepted

Being able to access gitolite@server:~/repositories/gitolite-admin.git, but not gitolite@server:gitolite-admin indicates you are not going “through” Gitolite, but just using plain SSH-based access to the gitolite user.

If ssh gitolite@server echo normal access yields normal access, then the key you are using is not restricted to going through Gitolite. If you were going through Gitolite you would see something like bad command: echo normal access.

This can happen if you have a key that you use to SSH into the gitolite user itself and you try to use that same key to authenticate as a Gitolite user. A “normal access” key will be present in gitolite’s .ssh/authorized_keys without any special prefix. The line for a key that is configured to go through Gitolite will start like command="/path/to/gl-auth-command gitolite-username",….

If you need normal SSH-based access to the gitolite user and Gitolite-based access, then you should setup separate keys for those purposes so that you can specify which key you want to use with IdentityFile options in your .ssh/config file (maybe also IdentitiesOnly if you find that ssh is using the “wrong” key just because you already have it loaded in your ssh-agent).

For example:

Use one of your “default” keys (one of ssh’s defaults (e.g. ~/.ssh/id_rsa) or some key that you usually have loaded in your ssh-agent) to access Gitolite (i.e. you have the public key in the active keydir/

Generate ~/.ssh/gitolite-user for use in directly logging into the gitolite user. Use ssh -i ~/.ssh/gitolite-user gitolite@server to login. Or, add a custom entry to ~/.ssh/config:

Host gitolite-user
              User gitolite
          HostName server
      IdentityFile ~/.ssh/gitolite-user
    IdentitiesOnly yes

so you can just do ssh gitolite-user to login.

share|improve this answer
This post was actually very helpful in getting me on the right track. You are absolutely correct -- I was not going "through" Gitolite. One of my issues apparently also was that I ran gl-setup with a user other than the gitolite user, yet was still following the instructions to clone by using the gitolite user. By cloning from the gl-setup user (the user that was listed with that special command="..." stuff) I was able to successfully get in "through" gitolite. Thank you. – invalidsyntax May 18 '11 at 12:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.