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

Configuring Protected Branch Rules

Constraints

  • To configure protected branch rules for a repository, you need to have the necessary permissions. For details, see Configuring Repo-Level Permissions.
  • Only one protected branch rule can be created for a branch. Otherwise, the error message indicating 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 1.

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.