Skip to main content

Creating and deleting branches within your repository

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

Creating a branch

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

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

Creating a branch via the branches overview

  1. On GitHub.com, navigate to the main page of the repository.
  2. Encima de la lista de archivos, haz clic en Ramas. Vínculo de ramas en la página de información general
  3. Click New branch. Screenshot of branches overview page with new branch button emphasized
  4. In the dialog box, enter the branch name and optionally change the branch source.
    If the repository is a fork, you also have the option to select the upstream repository as the branch source. Screenshot of branch creation modal for a fork with branch source emphasized
  5. Click Create branch. Screenshot of branch creation modal with create branch button emphasized

Creating a branch using the branch dropdown

  1. On GitHub.com, 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

Creating a branch for an issue

You can create a branch to work on an issue directly from the issue page and get started right away. For more information, see "Creating a branch to work on an issue".

Deleting a branch

Puedes hacer que se eliminen automáticamente ramas centrales después de que se fusionen solicitudes de extracción en tu repositorio. Para más información, vea "Administración de la eliminación automática de ramas".

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 GitHub.com, navigate to the main page of the repository.

  2. Encima de la lista de archivos, haz clic en Ramas. Vínculo de ramas en la página de información general

  3. Scroll to the branch that you want to delete, then click . delete the branch

  4. If you try to delete a branch that is associated with at least one open pull request, you must confirm that you intend to close the pull request(s).

    Confirm deleting a branch

Si borras una rama de encabezado después de haber fusionado su solicitud de extracción, GitHub verificará cualquier solicitud de extracción abierta en el mismo repositorio que especifique la rama borrada como su rama base. GitHub actualiza automáticamente cualquier solicitud de extracción, cambiando su rama base a la rama base de la solicitud de extracción que se ha fusionado. For more information, see "About branches."

Further reading