Connecting a Hosted Repository

You can connect a GCP repository to a Git repository hosted on GitHub or Bitbucket. When you push changes to the hosted repository, the changes are automatically synchronized with the GCP repository.

Connecting a repository

To connect a GCP repository to a hosted repository:

  1. Open the source view in the console:

    Open the Source View in the Console

  2. From the top menu, select a project for the new repository.

  3. If this is your first time creating a repository for this project, click Get Started. Otherwise, click Create Repository.

  4. In the dialog box that opens, type a name for your repository.

    A screen opens, displaying several options for adding code to the repository.

  5. Select Automatically Mirror from GitHub or Bitbucket:

    Mirror from GitHub or Bitbucket

  6. Select your hosting service and click Connect.

  7. If you have not previously authorized access to the hosting service from Google Cloud Platform, read and consider the authentication request displayed in the authentication page that appears in your browser. Click Authorize Application if you consent to the request.

  8. Select a repository in the dialog box that is displayed. Select the Consent option if you consent to Google collecting and storing your authentication token.

    Choose repository

  9. Click Connect.

Disconnecting a repository

To disconnect a hosted repository:

  1. Click the Settings button View repository files in the source code browser.

  2. Click Disconnect.

After you have disconnected, the repository is deleted from the GCP repository.

Was this page helpful? Let us know how we did:

Send feedback about...

Cloud Source Repositories