Installing gitolite on a Mac

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.

This entry was posted in Mac and tagged , , , , . Bookmark the permalink.

3 Responses to Installing gitolite on a Mac

  1. greg says:

    Hey there,

    I was having the exact same issue you’re mentioning. The git user’s PATH was fine, so I thought I’d edit the .gitolite.rc file to point gitolite to the git binaries (even though they were already on the PATH in my case).

    Still no luck. The way I understand it, it should work even if I edit the file *after* the install, right ? Any clue ?

  2. greg says:

    Nevermind my previous comment, I misread your GIT_PATH as set to ../bin/git instead ../git/bin, so I wrongly set mine to “/opt/local/bin/git” instead of “/opt/local/bin” which now works.

    Thanks for the article !

  3. I’m glad you found it helpful, Greg. :)

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" cssfile="">