Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I want to host some git-Repositories.

Is it possible to setup them like SVN-Repos with a central ACL-File? (Have a look at AuthzSVNAccessFile-Directive for example)

Thanks, Philipp

share|improve this question

1 Answer 1

I have solved this in our environment with Gitolite, Gitweb and LDAP. Gitolite is extremely powerful and supports ACLs and authorization even better than Subversion (e.g. Subversion does not know how to talk to an LDAP directory). I suggest you read up on Gitolite here. Since you have tagged your question with apache2 you probably want to try using the HTTP backend for Git and Gitolite, for which you can find a complete setup guide here (for Gitolite g2).

A quick rundown of our setup: the LDAP directory contains groups (posixGroup in our case) that are named according to the Git repos defined in Gitolite; access to repos is based on these groups. Gitolite uses a simple Perl or Bash script (see here for example scripts) to query the directory for a user's group memberships and can thus decide whether and how a user may access a given repository. This requires the "big config" setup (Gitolite g2) and LDAP support, but you can just as easily define your ACLs statically, without LDAP.

Gitweb is just icing on the cake but if you use it, you probably want your users to only see the repos for which the have permissions. Gitweb allows for that by doing per-repo authorization based on the Gitolite ACLs defined. See here for details.

As you can see there are quite a few parts interacting with each other, so be sure to thoroughly read (and understand) the Gitolite documentation, it is quite comprehensive.

Edit: As a result of the release of Gitolite g3 and restructuring of the Gitolite documentation by Sitaram Chamarty many links have been broken since this post was made. I've updated them as best I could but some still point to the documentation for Gitolite g2. This is because some concepts changed heavily from g2 to g3 (like the "big setup" or).

share|improve this answer
1  
@sysadmin1138 I've updated the links as best I could. Much has changed in Gitolite and its documentation since I made that post. –  daff Apr 30 '13 at 2:02

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.