Skip to main content

Deleting a codespace

You can delete a codespace you no longer need.

GitHub Codespaces está disponible para las organizaciones que usen GitHub Team o GitHub Enterprise Cloud. GitHub Codespaces también está disponible como versión beta limitada para usuarios individuales en los planes GitHub Free y GitHub Pro. Para más información, vea "Productos de GitHub".

There are costs associated with storing codespaces. You should therefore delete any codespaces you no longer need. For more information, see "About billing for GitHub Codespaces."

Hay límites para el número de codespaces que puede crear y el número de codespaces que puede ejecutar al mismo tiempo. Estos límites varían en función de varios factores. Si alcanza el número máximo de codespaces e intenta crear otro, se muestra un mensaje que indica que debe quitar un codespace existente para poder crear uno nuevo.

Deleting a codespace

  1. Navigate to the "Your codespaces" page at github.com/codespaces.

  2. To the right of the codespace you want to delete, click , then click Delete

    Delete button

Puedes eliminar codespaces desde VS Code cuando no estás trabajando actualmente en un codespace.

  1. En VS Code, en la barra lateral izquierda, haz clic en el icono de Explorador Remoto.

    El icono de Remote Explorer (Explorador remoto) en Visual Studio Code

    Nota: Si el Explorador remoto no se muestra en la barra de actividad:

    1. Abra la paleta de comandos. Por ejemplo, presionando el Comando+Shift+P (Mac) / Ctrl+Shift+P (Windows/Linux).
    2. Escriba: codespaces.
    3. Haz clic en Codespaces: Detalles.
  2. En "CODESPACES DE GITHUB", haz clic con el botón derecho en el codespace que quieras eliminar.

  3. Haz clic en Eliminar codespace.

    Borrar un codespace en GitHub

Para obtener más información sobre GitHub CLI, vea "Acerca de GitHub CLI".

To delete a codespace use the gh codespace delete subcommand and then choose a codespace from the list that's displayed.

gh codespace delete

If you have unsaved changes, you'll be prompted to confirm deletion. You can use the --force flag to force deletion, avoiding this prompt.

For more information about this command, see the GitHub CLI manual.

Bulk deleting codespaces

You can use GitHub CLI to delete several or all of your codespaces with a single command. For more information, click the GitHub CLI tab near the top of this page.

You can use GitHub CLI to delete several or all of your codespaces with a single command. For more information, click the GitHub CLI tab near the top of this page.

You can delete several or all of your codespaces with a single command, using gh codespace delete followed by one of these flags:

--all - Delete all of your codespaces.

--repo REPOSITORY - Delete all of your codespaces for this repository. Or use together with the --days flag to filter by age of the codespace.

--days NUMBER - Delete all of your codespaces that are older than the specified number of days. Can be used together with the --repo flag.

By default you are prompted to confirm deletion of any codespaces that contain unsaved changes. You can use the --force flag to skip this confirmation.

Example

Delete all of the codespaces for the octo-org/octo-repo repository that you created more than 7 days ago.

gh cs delete --repo octo-org/octo-repo --days 7

Deleting codespaces in your organization

As an organization owner, you can use GitHub CLI to delete any codespace in your organization.

For more information, click the "GitHub CLI" tab near the top of this page.

For more information, click the "GitHub CLI" tab near the top of this page.

  1. Enter one of these commands to display a list of codespaces.

    • gh codespace delete --org ORGANIZATION - Lists the current codespaces in the specified organization.
    • gh codespace delete --org ORGANIZATION --user USER - Lists only those codespaces created by the specified user. You must be an owner of the specified organization.
  2. In the list of codespaces, navigate to the codespace you want to delete.

  3. To delete the selected codespace press Enter.

    If the codespace contains unsaved changes you will be prompted to confirm deletion.

You can also use the REST API to delete codespaces for your organization. For more information, see "Codespaces organizations."

Further reading