Updated on 2025-03-27 GMT+08:00

Configuring Protected Branch Rules

Constraints

Project manager or project administrator can set project-level protected branch rules.

Configuring Protected Branch Rules

CodeArts Repo makes a code branch more secure by preventing anyone other than the administrator from committing code, preventing anyone from forcibly committing code, or from deleting the branch. You can set this branch to be protected. The procedure is as follows: On the CodeArts Repo homepage, go to a project, choose Settings > Policy Settings > Protected Branches, click Create Protected Branch, and set parameters as follows.

  1. Enter a branch name. This parameter is mandatory. Enter a complete branch name or a branch name with wildcard characters. If a branch contains a single slash (/), the branch cannot be matched using the wildcard * due to the fnmatch syntax rule.
  2. You can set the push or merge permission for the administrator/project manager, committer, and developer. These two permissions cannot be granted at the same time because code cannot be forcibly pushed or merged into the protected branch. You can create, edit, and delete protected branches in batches.

If you want all repository groups and repositories in this project to use the preceding settings, select Force Inherit.