Ripping my hair out, setting up Gitolite on FreeBSD
Today I spent a great deal of time trying to figure out why my installation of gitolite wasn’t working. Specifically, it seemed to have been set up correctly, but whenever I tried to ssh into the account, or run git clone on the gitolite-admin repository, I’d get this cryptic error:
$ git clone ssh://git@myhost/gitolite-admin.git Cloning into 'gitolite-admin'... fatal: unrecognized command '/usr/local/gitolite/bin/gitolite-shell myuser' fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
Everything I tried was fruitless. At first I was thinking it was permission errors based on where I had originally installed gitolab. Then I tried looking over sshd config for odd configuration mishaps. I even went so far as to test for some horrible bug involving jails. Nothing helped, same error over and over.
Finally, thanks to graudeejs on the FreeBSD forums, I found the problem.
When I was setting up the jail, I installed git along with the git user account, and I enabled the option of having git-shell as the shell for the git user. This was the problem.
From graudeejs’s post:
Freeking found the problem... When I created account, I set shell to be /usr/local/libexec/git-core/git-shell, because at that time, I thought I'll be using it.... Now when I reset shell back to /bin/sh everything works again
So that was it. All I had to do was change the shell for the git user.
chsh -s /bin/sh git
After that, everything worked!











