Skip to main content

codespace を削除する

不要になった codespace を削除することができます。

Codespaces is available for organizations using GitHub Team or GitHub Enterprise Cloud. 詳しい情報については「GitHubの製品」を参照してください。

リポジトリごと、さらにはブランチごとに1つ以上のcodespaceを作成できます。 However, each personal account has a limit of 10 codespaces. この制限に達した場合に新しいcodespaceを作成したいなら、まずcodespaceを削除しなければなりません。

注釈: codespace を作成したユーザだけが削除できます。 現在、Organization のオーナーが Organization 内で作成された Codespaces を削除する方法はありません。

codespace を削除する

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

  2. 削除する codespace の右側で をクリックし、 [Delete] をクリックします。

    削除ボタン

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

  1. VS Codeの左サイドバーで、 Remote Explorerのアイコンをクリックしてください。 Visual Studio CodeのRemote Explorerアイコン

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

  3. Click Delete Codespace.

    GitHub で Codespaces を削除する

To learn more about GitHub CLI, see "About 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.

サンプル

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

参考リンク