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 having issues setting up gitolite. Server is Mac OS X Server 10.5.8 and client is Mac OS X 10.6.6. Both are running git compiled from source.

I'm following the documentation as best as I can, but it really needs a major overhaul and is confusing in places. I don't think the author dogfooded it.

I used the "root method" installation. The issue is when I run the final step: cd; git clone git@server:gitolite-admin

Here's what's going on from the client side:

tom@client$ ssh info
hello tom, the gitolite version here is v1.5.8-22-g6bcb5c1
the gitolite config gives you the following access:
     R   W      gitolite-admin
    @R_ @W_     testing
tom@client$ git clone
Cloning into gitolite-admin...
Can't exec "git": No such file or directory at /usr/local/bin/gl-auth-command line 176.
fatal: The remote end hung up unexpectedly


As a result, it's a lot easier to debug. Just run ssh git@server info. If this get you the gitolite version and access info, everything is fine. If it asks you for a password, see the very first section of this document for help.

Thus I conclude that the SSH part of gitolite is properly configured.


admin@server$ su - git
git@server$ which git
git@server$ which gl-auth-command
git@server$ tail -n 2 /usr/local/bin/gl-auth-command 
$repo = "'$REPO_BASE/$repo.git'";
exec("git", "shell", "-c", "$verb $repo") unless $verb eq 'git-init';

git is available on the server as is in the git user's $PATH.

I have used 'tail' to show the last two lines, 175 and 176, as apparently the last line is the one that's failing.

What the heck is wrong? I've been bashing my head into the wall with this.

share|improve this question
up vote 3 down vote accepted

This looks like it might be the same problem as described here:

gitolite setup on Mac => git-upload-pack: command not found [SOLVED]

Interactive sessions don't necessarily have the same environment variables set as non-interactive sessions. Try adding the PATH to git (/usr/local/bin) to a shell init file for the git user that's read in both interactive and non-interactive sessions. If the git user's shell is bash, try ~git/.bashrc .

share|improve this answer
Interesting. I added a trivial .bashrc file to my git user's home directory (essentially, "export PATH=/usr/local/bin:$PATH") and that seems to have fixed it. Thanks :) – Shaggy Frog Jan 26 '11 at 21:16

You can set the $GIT_PATH variable in the gitolite.rc file if gl-auth-command is unable to locate the git install location. See for more info.

It appears that /usr/local/bin/ is not part of $PATH when gl-auth-command is run from ssh so your shell must be adding it when you login normally but not during a non-login non-interactive usage.

share|improve this answer
Unfortunately, setting $GIT_PATH did not resolve the issue. – Shaggy Frog Jan 26 '11 at 21:13

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.