删除代码库

本主题介绍如何使用 Google Cloud 控制台或命令行删除代码库。

要删除代码库,请按照下列步骤操作。

控制台

  1. 在 GCP Console 中,为 Cloud Source Repositories 打开 所有代码库 页面。

    打开 Cloud Source Repositories

  2. 将指针放在要删除的代码库上,然后点击 设置

    常规设置 页面打开。

  3. 点击 删除此代码库

    移除代码库 对话框打开。

  4. 输入您要删除的代码库的名称。

  5. 点击删除

gcloud

在终端窗口中,输入以下命令:

gcloud init
gcloud source repos delete [REPOSITORY_NAME]

其中 [REPOSITORY_NAME] 是代码库的名称。

回答如下所示:

If [REPOSITORY_NAME] is deleted, the name cannot be reused for up to
seven days.

Delete "[REPOSITORY_NAME]" in project "gcloud-test" (Y/n)?  y

Deleted [REPOSITORY_NAME].