The repo access rights on a DVCS is always linked to the all repo, not part of if, mainly because you clone all of it (shallow clone is hard).
That means gitolite (I won't even mention gitosis which is obsolete) can establish restrictions on:
- accessing a all repo
- writing only certain branches (but you cannot limit read access to certain branch)
But it cannot prevent a user to access parts of a repo.
However, since gitolite v3 or 'g3' (April 17th, 2012), you can, with VREF rules, prevent writing (pushing to) certain directories (in addition of certain branches).
Original answer (gitolite V2 or 'g2', November 2011)
See gitolite.conf
-- by example and side note: "R" permissions for refs
repo gitolite-admin
RW+ = sitaram
# this is equivalent to:
RW+ refs/.* = sitaram
Sitaram is the only admin. He can push, create, delete, or rewind any branch or tag in the gitolite-admin repo.
R master = wally # MEANINGLESS! WILL NOT DO WHAT YOU THINK IT DOES!
This won't work.
You can only restrict "read" access at the repo level, not at the branch level.
This is a git issue, not a gitolite issue. Go bother them, or switch to gerrit.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…