Through Cloud Code, you can add new projects to Cloud Source Repositories and check out existing projects.
Before you begin
- 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.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project : Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
- Create a project
: To create a project, you need the Project Creator
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles .
-
Verify that billing is enabled for your Google Cloud project .
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project : Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
- Create a project
: To create a project, you need the Project Creator
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles .
-
Verify that billing is enabled for your Google Cloud project .
Upload source code
Upload your code to Cloud Source Repositories from Cloud Code:
-
Open the project you want to add to Cloud Source Repositories.
-
Click VCS> Upload to Cloud Source Repositories. Alternatively, in the menu, navigate to Tools > Google Cloud Code > Upload to Cloud Source Repositories.
-
In the dialog, use the drop down menu to select the Cloud Projectassociated with your project.
-
Use the drop down menu to select your Cloud Repository.
-
If you don't have a repository, or if you want to create a new one, click Create a new cloud repository.
Cloud Code opens a new browser window to the Google Cloud console so that you can create the new repository.
-
-
By default, Cloud Code sets the Remote Name. You can enter a different name in the New Remote Namefield.
-
Click Upload.
Development
For other operations such as committing and pushing new changes, navigate to VCS > VCS Operations Popup.
Browse source files
After uploading your source code, browse the code in the Google Cloud console:
-
In the Google Cloud console , select the project that contains your source code.
-
In the search bar, search for
Cloud Source Repositories.
Check out source code
Check out source code from Cloud Source Repositories:
- Choose VCS > Get from Version Control. Alternatively, go to the welcome dialog and click Get from VSC .
- Select Google Cloudfrom the Version Controldrop-down and click Clone.
- In the Clone from Google Clouddialog, select the Cloud Projectassociated with your project.
- Select your Cloud Repository.
- Select the Parent Directory.
- Enter the Directory Name.
- Click Clone.
You can alternatively check out from the Welcomescreen by selecting Get from Version Controland choosing Google Cloudfrom the Version Control drop-down. This displays the Clone from Google Clouddialog.

