如何在gerrit下创建自定义命名空间?
How to create custom namespace under gerrit?
我想允许开发人员自由地create/delete分支,推送到他们,强制推送等。但我不希望任何开发人员意外删除或强制推送到master或任何Release分支。
从文档中我怀疑这可以通过创建自定义命名空间来实现,在 gerrit documentation 你可以找到:
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.
这就是我想要的,允许所有开发人员在 refs/heads/dev/*
下拥有全部权利,但问题是我如何创建 dev
?这是标准方法吗?
是的,这是标准方法。
要创建 "dev" 分支,您可以:
- 推送到ref/heads/dev
或
使用 Gerrit UI 创建分支:
- 单击:项目 > 列表
- Select 项目
- 点击:分支机构
- 填写:分支名称=dev
- Fill: Initial Revision = some_ref (master, 例如)
- 点击:创建分支
我想允许开发人员自由地create/delete分支,推送到他们,强制推送等。但我不希望任何开发人员意外删除或强制推送到master或任何Release分支。
从文档中我怀疑这可以通过创建自定义命名空间来实现,在 gerrit documentation 你可以找到:
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.
这就是我想要的,允许所有开发人员在 refs/heads/dev/*
下拥有全部权利,但问题是我如何创建 dev
?这是标准方法吗?
是的,这是标准方法。
要创建 "dev" 分支,您可以:
- 推送到ref/heads/dev
或
使用 Gerrit UI 创建分支:
- 单击:项目 > 列表
- Select 项目
- 点击:分支机构
- 填写:分支名称=dev
- Fill: Initial Revision = some_ref (master, 例如)
- 点击:创建分支