1
0
mirror of synced 2025-12-23 21:07:12 -05:00
Files
docs/content/github/administering-a-repository/enabling-force-pushes-to-a-protected-branch.md
2020-11-02 15:12:44 -06:00

1.9 KiB

title, intro, product, versions
title intro product versions
Enabling force pushes to a protected branch You can allow force pushes to a protected branch. {% data reusables.gated-features.protected-branches %}
free-pro-team enterprise-server github-ae
* >=2.20 *

Anyone with admin permissions to a repository can enable force pushes.

About force pushes to protected branches

By default, force pushes are blocked on all protected branches. When you enable force pushes to a protected branch, anyone with at least write permissions to the repository can force push to the branch, including those with admin permissions.

Enabling force pushes will not override any other branch protection rules. For example, if a branch requires a linear commit history, you cannot force push merge commits to that branch.

{% if enterpriseServerVersions contains currentVersion or currentVersion == "github-ae@latest" %}You cannot enable force pushes for a protected branch if a site administrator has blocked force pushes to all branches in your repository. For more information, see "[Blocking force pushes to repositories owned by a user account or organization](/enterprise/{{ currentVersion }}/admin/developer-workflow/blocking-force-pushes-to-repositories-owned-by-a-user-account-or-organization)."

If a site administrator has blocked force pushes to the default branch only, you can still enable force pushes for any other protected branch.{% endif %}

{% data reusables.repositories.protected-branches-options %}

Enabling force pushes

{% data reusables.repositories.navigate-to-repo %} {% data reusables.repositories.sidebar-settings %} {% data reusables.repositories.repository-branches %} {% data reusables.repositories.add-branch-protection-rules %} 6. Under "Rules applied to everyone including administrators", select Allow force pushes. Allow force pushes option 7. Click Create.