Updated on 2023-05-06 GMT+08:00

Protected Branches

Protected branches have the following functions:

  • Ensure branch security and allow developers to use merge requests to merge code.
  • Prevent non-administrators from pushing codes.
  • Prevent all forcibly push to this branch.
  • Prevent anyone from deleting this branch.

On the Protected Branches page, you can configure a specified branch to limit it using any of the following rules:

  • Whether an administrator has the commit permission.
  • Whether a developer has the commit permission.
  • Whether an administrator has the merge permission.
  • Whether a developer has the merge permission.

To configure protected branches, choose Settings > Repository Management > Protected Branches in the repository details.

The settings take effect only for the repository configured.

Only the repository administrators and owners can view this tab page and configure protected branches.