Using gitosis to specify permissions per branch?
Asked Answered
A

4

10

With gitosis, is it possible to specify write permissions so that users can push freely to branches with their own name, but not merge with the master? E.g. $USER/test1 .. $USER/test5

This mean you could host just one repository per project, rather than hosting multiple repositories for the same project, specific to each user:

 project1-user1
 project1-user2
 project1-user3
 ...
 project5-user1
 project5-user2
 project5-user3
Authorized answered 23/2, 2009 at 22:43 Comment(0)
A
1

Gitosis controls access to repositories, but not by branch or commit. So you could put the master in a repo by itself which had read-only access and let users push their individual branches to another repo ( or one per user, as you say). I haven't seen anyone extend gitosis for finer-grain control.

If you really need to restrict your users' access that much and you want to use Git, then perhaps you should only take patches by e-mail and keep your repo as read-only.

Ambi answered 24/2, 2009 at 4:36 Comment(1)
I forgot this question! I've been using gitosis for over a year now and I've been really happy with it.Authorized
C
20

The Gitolite project offers this functionality. It's a rewrite of Gitosis in Perl. Its code can be found on github

When I first wrote this answer, it didn't support gitweb or git-daemon integration, but it does now.

Chuckwalla answered 14/9, 2009 at 1:16 Comment(0)
T
3

This script seems to do per branch access control:

http://www.kernel.org/pub/software/scm/git/docs/howto/update-hook-example.txt

Triangular answered 24/7, 2009 at 8:48 Comment(1)
That link is now out of date, as git docs are no longer hosted at kernel.orgRetrocede
A
1

Gitosis controls access to repositories, but not by branch or commit. So you could put the master in a repo by itself which had read-only access and let users push their individual branches to another repo ( or one per user, as you say). I haven't seen anyone extend gitosis for finer-grain control.

If you really need to restrict your users' access that much and you want to use Git, then perhaps you should only take patches by e-mail and keep your repo as read-only.

Ambi answered 24/2, 2009 at 4:36 Comment(1)
I forgot this question! I've been using gitosis for over a year now and I've been really happy with it.Authorized
T
0

Gitolite supports permission by branch or tag names quite well.

In the Pro GIT book, this section explains in detail how to set it up and configure per branch access right. Search "Config File and Access Control Rules" within that page.

Transducer answered 23/9, 2011 at 8:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.