在 Cloud Code for IntelliJ 中使用 Cloud Source Repositories

通过 Cloud Code,您可以将新项目添加到 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.

上传源代码

将代码从 Cloud Code 上传到 Cloud Source Repositories:

  1. 打开要添加到 Cloud Source Repositories 的项目。

  2. 依次点击 VCS > Upload to Cloud Source Repositories。或者,在菜单中依次选择 Tools > Google Cloud Code > Upload to Cloud Source Repositories

  3. 在对话框中,使用相应下拉菜单选择与您的项目关联的 Cloud 项目

  4. 使用下拉菜单选择您的云端代码库

    1. 如果您没有代码库,或者要创建新的代码库,请点击 Create a new cloud repository

      Cloud Code 会在新的浏览器窗口中打开 Google Cloud 控制台,以便您创建新的代码库。

  5. 默认情况下,Cloud Code 会设置远程名称。您可以在 New Remote Name 字段中输入其他名称。

  6. 点击上传

开发

如需执行其他操作(例如提交和推送新更改),请前往 VCS > VCS 操作弹出式窗口

浏览源文件

上传源代码后,要在 Google Cloud 控制台中浏览它们,请执行以下步骤:

  1. Google Cloud 控制台中,选择包含您的源代码的项目。

  2. 在搜索栏中,搜索 Cloud Source Repositories

查看源代码

如需从 Cloud Source Repositories 中签出源代码,请执行以下操作:

  1. 依次选择 VCS > Get from Version Control。或者,前往欢迎对话框,然后点击 Get from VSC
  2. Version Control 下拉列表中选择 Google Cloud,然后点击 Clone
  3. Clone from Google Cloud 对话框中,选择与您的项目关联的 Cloud 项目
  4. 选择您的云端代码库
  5. 选择父级目录
  6. 输入目录名称
  7. 点击克隆

您也可以从 Welcome 屏幕中签出,方法是选择 Get from Version Control,然后从“Version Control”下拉列表中选择 Google Cloud。此时将显示 Clone from Google Cloud 对话框。

获取支持

如需在 IntelliJ IDE 中提交反馈或报告问题,请前往工具 > Cloud Code > 帮助 / 简介 > 提交反馈或报告问题,在 GitHub 上报告问题。