启用和停用服务

本页介绍了启用或停用 Cloud Source Repositories 所需的步骤。

启用服务

  1. Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  3. Make sure that billing is enabled for your Google Cloud project.

  4. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  5. Make sure that billing is enabled for your Google Cloud project.

  6. Install the Google Cloud CLI.
  7. To initialize the gcloud CLI, run the following command:

    gcloud init
  8. 验证您是否拥有最新版本的 Git
  9. 如果您尚未在 Git 中配置用户凭据,请按照首次设置说明进行操作。
  10. Google Cloud 控制台 或使用以下 Google Cloud CLI 命令:
    gcloud services enable sourcerepo.googleapis.com

停用服务

  1. 在停用 Cloud Source Repositories API 之前,请确保要保留的所有代码在其他位置提供。

  2. 建议您在停用 API 之前先删除代码库

  3. 如需停用 Cloud Source Repositories,请针对当前项目运行以下命令:

    gcloud services disable sourcerepos.googleapis.com