Create a new application from a custom sample in Cloud Code for Cloud Shell

A sample repository is a Git repository that contains custom samples you can useto develop applications. After you'veset up your sample repository, you canstart creating applications with these samples.

Alternatively, you can import theCloud Code custom sample sample repositoryto try custom samples. To better understand how custom sample repositoriesare set up, it is recommended that you try cloning the repository and modifyingits structure and content before importing it. You can do this by creating newsamples in the repository or modifying the source code to create your ownversions of the Hello World or Guestbook apps.


To follow step-by-step guidance for this task directly in the Cloud Shell Editor, clickGuide me:

Guide me


Creating your app from an imported sample

To create a new application using a sample from your sample repository:

  1. Copy the Git URL of the sample repository that you'd like to use. If you'reusing a Git repository hosted live on your local machine, the.git suffixis omitted and the URL is of the form/path/to/repo.

    Note: Using anHTTPS Git URL is recommended. To use a SSH URL, you'llneed to generate and configure SSH keys. For more information, see thedocumentation for your Git repository hosting service. For example,GitHub,Bitbucket,andGitLab.
  2. In the Cloud Code status bar, click the active project name.

    Active project name in status bar

  3. In the Quick Pick menu that appears, selectNew Application.

  4. When you're prompted for the type of sample to use, selectCustomapplication.

  5. ClickImport Sample from Repo.

  6. When you're prompted for the URL, enter the Git URL you copied earlier.

    The URL in this example uses the HTTPS GitHub format:https://github.com/username/repo-name.git.

    Troubleshooting tip: If you're having trouble with Git authentication,check to see that your Cloud Shell Git login is set up properly. SeeUsing version control with Cloud Shell Editorfor details.

  7. To use the latest version of your samples in Cloud Code, clickrefreshRefresh Templates.

  8. Check the terminal window in your IDE to confirm that your repository has beencloned successfully.

    The repository's default branch is automatically used. To use another branch:

    1. Edit the branch in use or the repository URL in yoursettings.json fileundercloudcode.customApplications.
    2. ClickCustom Application.
    3. ClickrefreshRefresh.

    If your repository wasn't cloned successfully,you can use the Manage Repositories option to update your sample repositorydetails with a valid Git URL and/or branch.

  9. From the updated list of samples, select your custom sample.

  10. Enter your project name and location.

  11. ClickCreate New Application.

    Cloud Code creates your app using your chosen sample and opensyour app for use.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-15 UTC.