Inheritable Branch Protection
The open-source Gitea project supports the branch protection feature. You can create some rules to protect specified branches in your repository. However, in the open-source Gitea project, a repository cannot share its rules with other repositories, which means that you may need to manually create some of the same rules for different repositories.
Gitea Enterprise provides the branch protection inheritance feature. With this feature, you can create some branch protection rules for an organization and have them take effect in all the organization's repositories.
This document explains how to use the branch protection inheritance feature.
Create branch protection rules for an organization
- Navigate to the organization's settings page.
- Navigate to the
Branchestab. - Click the
Add New Rulebutton.
Then you can create branch protection rules for your organization the same way you create rules for a repository.

Make a repository inherit its organization's branch protection rules
- Navigate to the repository's settings page.
- Navigate to the
Branchestab. - Check the
Enable branch protection inheritancecheckbox.
Branch protection rules inherited from your organization appear in the list with the tag Inherited from organization.
If you have administrator access to the organization,
the Inherited from organization tag is a link that navigates to your organization's branches setting page.

Inherited branch protection rules have higher priority than the repository's own rules.
Enable forced branch protection inheritance
You can force all of your organization's repositories to inherit your organization's branch protection rules
by checking the Force enable branch protection inheritance checkbox.

When you enable the forced branch protection inheritance,
the Enable branch protection inheritance checkbox is always checked and cannot be unchecked.

Control how status check contexts combine
When an organization rule enables required status checks, you can pick a Status check contexts strategy to decide how the organization's contexts interact with repository-specific contexts:
- Owner only (default): Only the organization's required contexts are enforced. Repository rules cannot add or override the list.
- Merge : The organization's contexts are always required. If the repository rule also enables status checks, its contexts are appended. Duplicate names will be de-duplicated.
- Repository only : The repository's contexts replace the organization's list.