如何在gerrit下创建自定义名称空间? [英] How to create custom namespace under gerrit?

查看:131
本文介绍了如何在gerrit下创建自定义名称空间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望允许开发人员自由创建/删除分支,推送给他们,强制推送等。但是我不希望任何开发人员意外删除或强行推送给主或任何发布分支。



从文档我怀疑这可以通过创建自定义命名空间来实现,在 gerrit文档,您可以找到:


例如,要授予在命名空间下创建新分支的可能性foo,您必须为应该拥有它的组授予onrefs / heads / foo / *权限。最后,如果您计划授予每个用户个人名称空间,他们可以自由创建任意数量的分支,您应该授予创建引用权限,以便可以创建新的分支。这是通过在参考模式中使用特殊的$ {username}关键字完成的,例如裁判/头/沙/ $ {用户名} / *。如果你这样做,也建议你授予用户推力许可,以清理陈旧的分支。


这是所有我想要的,以允许所有开发人员在 refs / heads / dev / * 下的完整权限,但问题是如何创建 dev ?这是一个标准的方法吗?

解决方案

是的,这是一个标准方法。



要创建dev分支,您可以:


  1. 推送至ref / heads / dev

OR


  1. Gerrit UI创建分支:
    $ b


    • 点击:Projects> List

    • 选择项目

    • 单击:分行

    • 填写:分行名称= dev

    • 填写:初始修订= some_ref(例如master)

    • 点击:创建分行



I would like to allow developers to freely create/delete branches, push to them, force push etc. But I dont want any developer to delete by accident or force push to master or any Release branch.

From documentation I suspect this can be achived by creating custom namespace, in gerrit documentation you can find:

For example, to grant the possibility to create new branches under the namespace foo, you have to grant this permission onrefs/heads/foo/* for the group that should have it. Finally, if you plan to grant each user a personal namespace in where they are free to create as many branches as they wish, you should grant the create reference permission so it’s possible to create new branches. This is done by using the special ${username} keyword in the reference pattern, e.g. refs/heads/sandbox/${username}/*. If you do, it’s also recommended you grant the users the push force permission to be able to clean up stale branches.

and this is all I want, to allow all developers full rights under refs/heads/dev/* but the question is how do I create dev? And is this a standard aproach?

解决方案

Yes, this is a standard approach.

To create the "dev" branch you can either:

  1. Push to ref/heads/dev

OR

  1. Use the Gerrit UI to create the branch:

    • Click on: Projects > List
    • Select the project
    • Click on: Branches
    • Fill: Branch Name = dev
    • Fill: Initial Revision = some_ref (master, for example)
    • Click on: Create Branch

这篇关于如何在gerrit下创建自定义名称空间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆