Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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 was wondering if it was possible to configure gitolite to let anybody clone a repository without having to do the whole public key song and dance.

Obviously I don't want people to be able to change the repo without a key first.

share|improve this question
up vote 4 down vote accepted

There are two options for public Git access:

  1. Git protocol, handled by git daemon:

    git daemon --base-path /srv/git

    If you run git daemon with --base-path /srv/git on, then if you later try to pull git://, git daemon will interpret the path as /srv/git/hello.git.

    For multiple "vhosts", --interpolated-path /srv/git/%H/%D would map the same to /srv/git/

    The --user-path option gives "userdir"-like translation of git:// to /home/user/hello.git.

    You can run git daemon from xinetd, or as a background daemon using the --detach option (sudo -u nobody git daemon --detach <other options>).

  2. Smart HTTP, which requires a web server: instructions on Pro Git

    This is a bit more complicated to set up, but crosses proxies and firewalls more easily (which may be an advantage in certain environments).

    It is possible to push over HTTP too – make sure you don't accidentally enable that.

share|improve this answer
and this wont interfere with the fact that the repo is already managed by gitolite? What happens if somebody is cloning with the public access and another person pushes with ssh at the same time? – Chris May 19 '11 at 19:08
@Chris: In Git, such operations are atomic, as in most modern VCSs. Besides, Gitolite doesn't deal with the inner structure, it mostly manages user access. It is very common usage to have the same repository served over Gitproto, SSH (sometimes Gitolite, more often just user@host:path), and even HTTP. – grawity May 19 '11 at 20:54
Also, you can use the special daemon user in the Gitolite configuration to automatically create the special git-daemon-export-ok file that git daemon looks for before allowing access through git:// URLs. – Chris Johnsen May 20 '11 at 4:54
Possible third option: How about making a read-only private key and put it up for download on a Web-site, then install the public key in Gitolite's keys directory ? -Would this be a security issue, or would Gitolite be able to handle it ? – user309044 Apr 30 '15 at 1:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .