Using Cloud Source Repositories

Through Cloud Code, you can add new projects to Cloud Source Repositories and check out existing projects.

Before you begin

  1. Sign in to your Google Account.

    If you don't already have one, sign up for a new account.

  2. In the Google Cloud Console, on the project selector page, select or create a Google Cloud project.

    Go to the project selector page

  3. Make sure that billing is enabled for your Cloud project. Learn how to confirm that billing is enabled for your project.

Uploading source code

Upload your code to Cloud Source Repositories from Cloud Code:

  1. Open the project you want to add to Cloud Source Repositories.

  2. Select VCS > Import into Version Control > Setup on Google Cloud Source Repositories.

    Screenshot showing the
navigation to the Setup on Cloud Source Repositories menu option.

  3. In the dialog, use the drop down menu to select the Cloud Project associated with your project.

  4. Use the drop down menu to select your Cloud Repository.

    1. If you don't have a repository, or if you want to create a new one, click Create a new cloud repository.

    2. Cloud Code will open a new browser window to the Google Cloud Console so that you can create the new repository.

      Screenshot showing
the fields to complete to upload code to Cloud Source Repositories.

  5. By default, Cloud Code sets the Remote Name. You can enter a different name in the New Remote Name field.

  6. Click Upload.

Browsing the source files

After uploading your source code, browse the code in the Google Cloud Console:

  1. In the Google Cloud Console, select the project that contains your source code.

  2. In the Tools section of the left navigation bar, select Development > Source Repositories.

Checking out the source code

Check out source code from Cloud Source Repositories:

  1. Choose VCS > Get from Version Control....

  2. Select 'Google Cloud' from the 'Version Control' dropdown and click 'Clone'.
  3. In the Clone from Google Cloud dialog, select the Cloud Project associated with your project.
  4. Select your Cloud Repository.
  5. Select the Parent Directory.
  6. Enter the Directory Name.
  7. Click Clone.

You can alternatively check out from the Welcome screen by selecting Get from Version Control and choosing Google Cloud from the Version Control dropdown. This displays the Clone from Google Cloud dialog.

Getting Support

To send feedback, report issues on GitHub, or ask a question on Stack Overflow.