问题
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?
回答1:
Yes, this is a standard approach.
To create the "dev" branch you can either:
- Push to ref/heads/dev
OR
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
来源:https://stackoverflow.com/questions/39120868/how-to-create-custom-namespace-under-gerrit