Skip to main content

Esta versão do GitHub Enterprise foi descontinuada em 2022-10-12. Nenhum lançamento de patch será feito, mesmo para questões críticas de segurança. Para obter melhor desempenho, segurança aprimorada e novos recursos, atualize para a última versão do GitHub Enterprise. Para obter ajuda com a atualização, entre em contato com o suporte do GitHub Enterprise.

Creating and deleting branches within your repository

You can create or delete branches directly on GitHub Enterprise Server.

Creating a branch

You can create a branch in different ways on GitHub Enterprise Server.

Note: You can only create a branch in a repository to which you have push access.

Creating a branch using the branch dropdown

  1. On your GitHub Enterprise Server instance, navigate to the main page of the repository.
  2. Optionally, if you want to create the new branch from a branch other than the default branch of the repository, click Branches then choose another branch. Branches link on overview page
  3. Click the branch selector menu. branch selector menu
  4. Type a unique name for your new branch, then select Create branch. branch creation text box

Deleting a branch

É possível excluir branches head automaticamente após o merge de pull requests no repositório. Para obter mais informações, confira "Como gerenciar a exclusão automática de branches".

Note: If the branch you want to delete is the repository's default branch, you must choose a new default branch before deleting the branch. For more information, see "Changing the default branch."

If the branch you want to delete is associated with an open pull request, you must merge or close the pull request before deleting the branch. For more information, see "Merging a pull request" or "Closing a pull request."

  1. On your GitHub Enterprise Server instance, navigate to the main page of the repository.
  2. Acima da lista de arquivos, clique em Branches. Link Branches na página de visão geral
  3. Scroll to the branch that you want to delete, then click . delete the branch

Se você excluir um branch de cabeçalho após o merge do seu pull request, o GitHub irá verificar se há quaisquer solicitações de pull no mesmo repositório que especificam o branch excluído como o branch base. O GitHub atualiza automaticamente quaisquer pull requests, alterando o branch base para o branch base do pull request mesclado. For more information, see "About branches."

Further reading