# Connect a source code repository

Developer Connect lets you integrate with non-Google products and services
so you can use them in supported Google products.

This quickstart shows you how to connect to [GitHub](https://docs.github.com/)
using a
[Git repository connection](https://docs.cloud.google.com/developer-connect/docs/git-repo-connections). This
type of connection is required for when you want to use
[Gemini Code Assist code customization](https://docs.cloud.google.com/gemini/docs/codeassist/code-customization-overview).

For a list of all the integrations that Developer Connect supports,
see [Developer Connect overview](https://docs.cloud.google.com/developer-connect/docs/overview).

## Before you begin

1. Make sure that you have a GitHub account and access to a repository hosted on GitHub.com. Or, follow the GitHub documentation to create new ones:
   - [Create a GitHub account](https://github.com/signup)
   - [Create a repository on GitHub.com](https://docs.github.com/en/repositories/creating-and-managing-repositories/quickstart-for-repositories)
2. If you're using an existing repository and you aren't the owner, ask the owner to grant admin-level permissions to the repository. If the repository is in a GitHub organization, request admin-level permissions from the organization owner. To learn more about GitHub organizations, see [GitHub account types](https://docs.github.com/en/get-started/learning-about-github/types-of-github-accounts).

## Initiate a connection

1. Open the **Developer Connect** page in the Google Cloud console.

   [Go to Developer Connect](https://console.cloud.google.com/developer-connect)

   The **Git Repositories** page opens, displaying a list of source code
   management providers.
2. Select a source code management provider by clicking **Connect** on the card
   for that provider.

   The **Create connection** page opens.
3. Choose `us-central1` as the region.

4. Enter `quickstart-connection` as the name.

5. Click **Continue**.

   The **Google Developer Connect** dialog appears requesting authorization to
   use your GitHub OAuth token.

   <br />

   If you don't see a dialog, turn off any pop-up blocking browser plug-ins and
   makes sure that your browser settings allow pop-ups. For example, in Chrome,
   follow the instructions to [allow pop-ups](https://support.google.com/chrome/answer/95472).
6. Click **I understand and continue**.

7. Complete the GitHub account sign-in steps if prompted to do so.

8. Click **Authorize Developer Connect** if prompted to do so. If you don't
   see this prompt, authorization has already been granted on this account.

## Configure the connection

Grant permissions on your GitHub account and repositories using the following
steps. The prompts depend on whether someone using the GitHub account has
already installed the **Google Developer Connect** app in GitHub.

- **If you see a list of GitHub accounts:** You don't have the app installed
  yet. Install and configure it by following these steps:

  1. Choose the GitHub account that has access to the repository you want to
     link.

  2. Specify GitHub repository permissions and install the app. For
     more information, see the GitHub instructions on [installing apps](https://docs.github.com/en/apps/using-github-apps/installing-a-github-app-from-a-third-party#installing-a-github-app).

- **If you see a prompt to re-use an existing installation:** Choose where to
  install and configure the app by following these steps:

  1. Click **GitHub Account** to see accounts that have the app installed. If
     you see the account you want to use, choose it.

     1. Click **Confirm**.
  2. If you don't see the account that you want to use, choose
     **Install the GitHub App on another GitHub account**.

     1. Click **Confirm**.

     2. Choose the GitHub account you want to use.

     3. Specify GitHub repository permissions and install the app. For
        more information, see the GitHub instructions on [installing apps](https://docs.github.com/en/apps/using-github-apps/installing-a-github-app-from-a-third-party#installing-a-github-app).

1. In **Repositories**, choose the repository you want to link.

2. Click **Link**.

The connection is added to the connections list, and the linked repository is
added to the repository list.

## Clean up


To avoid incurring charges to your Google Cloud account for
the resources used on this page, follow these steps.

1. In the Google Cloud console, go to the **Developer Connect** page.

   [Go to Developer Connect](https://console.cloud.google.com/developer-connect)
2. In the **Repositories** tab, in the row containing the name of the linked
   repository, click
   **More options**.

3. Choose **Unlink**.

4. Click **Confirm**.

5. Click the **Connections** tab.

6. In the row containing the name of your connection, click
   **More options**.

7. Choose **Delete**.

8. Enter the name of your connection.

9. Click **Confirm**.

Deleting connections and links doesn't delete the repositories on GitHub.com.
If you created a new GitHub repository for this quickstart and you want to
delete the repository, follow the GitHub instructions to
[delete a repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/deleting-a-repository).

If you want to uninstall the Google Developer Connect app, follow
the GitHub instructions on [modifying installed apps](https://docs.github.com/en/apps/using-github-apps/reviewing-and-modifying-installed-github-apps).

## What's next

- [Learn about Gemini Code Assist code customization](https://docs.cloud.google.com/gemini/docs/codeassist/code-customization-overview).
- [Build apps in Firebase App Hosting using GitHub repositories](https://firebase.google.com/docs/app-hosting).