Updated on 2025-07-24 GMT+08:00

Configuring Protected Branch Rules

Constraints

Table 1 Constraints on configuring protected branch rules

Item

Description

Permission constraint

To configure protected branch rules for a repository, you need to have the necessary permissions. For details, see Configuring Repo-Level Permissions.

Function constraint

Only one protected branch rule can be created for a branch. Otherwise, the error message indicating that the operation failed and the protected branch xxx already exists is displayed.

Configuring a Protected Branch

Go to the repository details page and choose Settings > Policy Settings > Protected Branches.

If you select Inherit from project, the settings of the project are automatically inherited and cannot be modified. If you do not select this option, see 2.

Managing a Protected Branch

Click in the row where the protected branch resides to modify the protected branch rule.

Click in the row where the protected branch resides to delete the protected branch rule.