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:
export PATH=/Users/git/bin:$PATH
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
$GIT_PATH="";
and change it to
$GIT_PATH="/usr/local/git/bin";
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.
