I’ve come to love gitolite for hosting private git repositories. It’s very easy to administer and trouble-free.
On one project, I needed to share a very large git repository between two virtual machines. I didn’t want the overhead of using a private git repository out on the Internet, just something local, like my workstation that runs OS X.
I used the System Preferences to create an account named git, and followed the gitolite install instructions.
I ran into a couple of problems that were easily resolved.
Path for Installer
First, to address gitolite complaining about not being able to find itself, I created a .bash_profile with the following:
Now I could run the gitolite install cleanly. I would recommend doing this first thing after creating the git account to host gitolite.
Help gitolite Find git
I installed git from the link on the front page of the git web site. This installs git in /usr/local/git/bin, which gitolite doesn’t like out of the box. The fix is easy. When gitolite installs, it brings up the config file (~/.gitolite.rc) in an editor for you to tweak.
Find the line
and change it to
This will prevent error messages such as
$ ssh git@localhost PTY allocation request failed on channel 0 Can't exec "git": No such file or directory at /Users/git/bin/gitolite.pm line 562. Use of uninitialized value $git_version in substitution (s///) at /Users/git/bin/gitolite.pm line 563. hello Yourkey, this is gitolite v2.2-4-the gitolite config gives you the following access: Use of uninitialized value $git_version in concatenation (.) or string at /Users/git/bin/gitolite.pm line 564. R W gitolite-admin @R_ @W_ testing Connection to localhost closed.
from appearing and preventing gitolite from working.
Update 1 September 2013
These instructions seem to still work with gitolite 3, with additional commentary:
If you ssh into your OS X machine, you might see the message:
$ ssh git@localhost PTY allocation request failed on channel 0
gitolite is still working. There is simply a collision between ssh versions. You an get a list of the repositories you’re allowed to access by one of these two commands:
$ ssh -T git@localhost $ ssh git@localhost info