在 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.

  6. 上傳原始碼

    從 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. 使用下拉式選單選取您的 Cloud Repository

      1. 如果您沒有存放區,或要建立新的存放區,請按一下 [Create a new cloud repository]

        Cloud Code 會開啟新的瀏覽器視窗,連至Google Cloud 主控台,方便您建立新的存放區。

    5. 根據預設,Cloud Code 會設定遠端名稱。您可以在「New Remote Name」欄位中輸入不同名稱。

    6. 按一下「上傳」。

    開發

    如要執行其他作業 (例如提交及推送新變更),請依序前往「VCS」>「VCS Operations Popup」

    瀏覽來源檔案

    上傳來源檔案之後,請瀏覽 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」(從 Google Cloud 複製) 對話方塊中,選取與您的專案相關聯的 Cloud 專案
    4. 選取您的 Cloud Repository
    5. 選取父項目錄
    6. 輸入目錄名稱
    7. 按一下 [Clone] (複製)。

    或者,您也可以從「Welcome」畫面取出,方法是選取「Get from Version Control」,然後從「Version Control」下拉式選單選擇「Google Cloud」。「Clone from Google Cloud」(從 Google Cloud 複製) 對話方塊隨即顯示。

    取得支援

    如要在 IntelliJ IDE 中提供意見回饋或回報問題,請依序前往「Tools」 >「Cloud Code」 >「Help / About」 >「Submit feedback or report an issue」,在 GitHub 回報問題。