Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer

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 example.com, then if you later try to pull git://example.com/hello.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/example.com/hello.git.

    The --user-path option gives "userdir"-like translation of git://example.com/~user/hello.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
2  
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.