使用 gitosis 指定每个分支的权限?

发布于 2024-07-14 13:51:33 字数 275 浏览 7 评论 0原文

使用gitosis,是否可以指定写权限,以便用户可以自由地推送到具有自己名称的分支,但不能与master合并? 例如 $USER/test1 .. $USER/test5

这意味着您可以为每个项目仅托管一个存储库,而不是为同一项目托管特定于每个用户的多个存储库:

 project1-user1
 project1-user2
 project1-user3
 ...
 project5-user1
 project5-user2
 project5-user3

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

智商已欠费 2024-07-21 13:51:33

Gitolite 项目提供了此功能。 它是用 Perl 重写的 Gitosis。 它的代码可以在在github上找到

当我第一次写这个答案时,它不支持gitwebgit-daemon 集成,但现在确实如此。

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.

西瑶 2024-07-21 13:51:33

Gitosis 控制对存储库的访问,但不是通过分支或提交来控制。 因此,您可以将主库本身放入具有只读访问权限的存储库中,并让用户将其各自的分支推送到另一个存储库(或者如您所说,每个用户一个)。 我还没有看到有人扩展 gitosis 来进行更细粒度的控制。

如果您确实需要限制用户的访问权限并且想要使用 Git,那么也许您应该只通过电子邮件获取补丁并将存储库保持为只读。

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.

庆幸我还是我 2024-07-21 13:51:33

Gitolite 很好地支持分支或标签名称的权限。

在 Pro GIT 书中,本节详细解释了如何设置和配置每个分支访问权。 在该页面中搜索“配置文件和访问控制规则”。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文