Publicamos atualizações frequentes em nossa documentação, e a tradução desta página ainda pode estar em andamento. Para obter as informações mais recentes, acesse a documentação em inglês. Se houver problemas com a tradução desta página, entre em contato conosco.
Versão do artigo: Enterprise Server 2.20

Enabling force pushes to a protected branch

You can allow force pushes to a protected branch.

Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server.

Neste artigo

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.

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."

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

You can automatically enforce protected branch settings for some or all branches in your repository. Para obter mais informações, consulte "Configurar branches protegidos".

Enabling force pushes

  1. No GitHub Enterprise, navegue até a página principal do repositório.
  2. Under your repository name, click Settings.
    Repository settings button
  3. In the left menu, click Branches.
    Repository options sub-menu
  4. Next to "Branch protection rules", click Add rule.
    Add branch protection rule button
  5. Under "Branch name pattern", type the branch name or pattern you want to protect.
    Branch rule field
  6. Under "Rules applied to everyone including administrators", select Allow force pushes.
    Allow force pushes option
  7. Click Create.

Pergunte a uma pessoa

Não consegue encontrar o que procura?

Entrar em contato