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.

Esta versão do GitHub Enterprise será descontinuada em Esta versão do GitHub Enterprise foi descontinuada em 2020-05-23. No patch releases will be made, even for critical security issues. For better performance, improved security, and new features, upgrade to the latest version of GitHub Enterprise. For help with the upgrade, contact GitHub Enterprise support.

Versão do artigo: Enterprise Server 2.17

Habilitar restrições de branch

You can enforce branch restrictions so that only certain users or teams can push to a protected branch in repositories owned by your organization.

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. The ability to restrict branches is a type of branch protection that's available for public and private repositories owned by organizations in GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server.

Anyone with admin permissions to an organization-owned repository can enable branch restrictions.

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

  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. Outra opção é selecionar Include administrators (Incluir administradores). This enforces all configured restrictions for repository administrators.
    Caixa de seleção Include administrators (Incluir administradores)
  7. Under "Protect matching branches", select Restrict who can push to matching branches.
    Caixa de seleção Branch restriction (Restrição de branch)
  8. Search for and select the people or teams who will have permission to push to the protected branch.
    Pesquisa de restrição de branch
  9. Click Create.

Further reading

Pergunte a uma pessoa

Não consegue encontrar o que procura?

Entrar em contato