Skip to main content

Deleting a codespace

You can delete a codespace you no longer need.

Codespaces está disponible para las organizaciones que utilicen GitHub Team o Nube de GitHub Enterprise. Para obtener más información, consulta la sección "Productos de GitHub".

Puedes crear más de un codespace por repositorio o incluso por rama. Sin embargo, cada cuenta personal tiene un límite de 10 codespaces. Si has alcanzado el límite y quieres crear un codespace nuevo, primero debes borrar un codespace.

Note: Only the person who created a codespace can delete it. There is currently no way for organization owners to delete codespaces created within their organization.

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

You can delete codespaces from within Visual Studio Code when you are not currently working in a codespace.

  1. En Visual Studio Code, en la barra lateral izquierda, da clic en el icono de Explorador Remoto. El icono de explorador remoto en Visual Studio Code

  2. Under "GITHUB CODESPACES", right-click the codespace you want to delete.

  3. Click Delete Codespace.

    Borrar un codespace en GitHub

Para aprender más sobre el CLI de GitHub, consulta la sección "Acerca del CLI de GitHub".

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 CLI de GitHub manual.

Bulk deleting codespaces

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

You can use CLI de GitHub to delete several or all of your codespaces with a single command. For more information, click the CLI de GitHub 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

Further reading