Connect to GitHub Enterprise Stay organized with collections Save and categorize content based on your preferences.
These instructions are for application developers, platform administrators, andsecurity managers who want to use GitHub Enterprise source code repositories with Google.Specifically, you can use GitHub Enterprise repositories withGemini Code Assist.
To learn more about Developer Connect, seeDeveloper Connect overview.
Before you begin
- Sign in to your Google Account.
If you don't already have one, sign up for a new account.
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Note: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the 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 role (
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission.Learn how to grant roles.
Verify that billing is enabled for your Google Cloud project.
Enable the Developer Connect API.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission.Learn how to grant roles.In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Note: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the 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 role (
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission.Learn how to grant roles.
Verify that billing is enabled for your Google Cloud project.
Enable the Developer Connect API.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission.Learn how to grant roles.Ensure that you have access to an account onGitHub Enterprise.
To help keep your team's work secure, we recommend that you complete the tasks in this guide using a bot account or an account shared by your team, not a personal account.
- Ensure that you own a GitHub Enterprise repository, or have admin-level permissions ona shared repository.
When using a repository in a GitHub Enterprise organization, ensure that you haveGitHub App Manager permissions.
- Optional: Create acustomer-managedencryption key (CMEK) for encrypting the authentication secrets thatDeveloper Connect creates.
- Optional: To use the command-line instructions in this guide, complete thefollowing steps:
- Install theGoogle Cloud CLI. If you've installed gcloud CLI previously, make sure you have the latest available version by running
gcloud components update. - Create aDeveloper Connect service account by running the following command, wherePROJECT_ID is yourGoogle Cloud project ID:
gcloudbetaservicesidentitycreate\--service=developerconnect.googleapis.com\--project=PROJECT_ID
- Install theGoogle Cloud CLI. If you've installed gcloud CLI previously, make sure you have the latest available version by running
Enabling Developer Connect also enables theSecret Manager API.
Grant the required IAM permissions
To get the permissions that you need to create connections and links, ask your administrator to grant you the following IAM roles:
- If you aren't the project owner:Developer Connect Admin (
roles/developerconnect.admin) on your user account. - If you plan to use a CMEK to encrypt the secrets that Developer Connect creates:Cloud KMS CryptoKey Encrypter/Decrypter (
roles/cloudkms.cryptoKeyEncrypterDecrypter) on the Secret Manager Service Account. - If you plan to use the gcloud CLI to complete the steps in this guide:Secret Manager Admin role (
roles/secretmanager.admin) on the Developer Connect Service Account. - If you plan to use the Google Cloud console to complete the steps in this guide:Project IAM Admin (
roles/resourcemanager.projectIamAdmin) on your user account.
For more information about granting roles, seeManage access to projects, folders, and organizations.
You might also be able to get the required permissions throughcustom roles or otherpredefined roles.
Note: When you have the Project IAM Admin(roles/resourcemanager.projectIamAdmin) role, the Google Cloud console canautomatically grant necessary permissions on your behalf. If your administratorwon't allow you to have the Project IAM Admin role, then ask your administratorto grant Secret Manager Admin (roles/secretmanager.admin) on theDeveloper Connect Service Account(service-{projectNumber}@gcp-sa-devconnect.iam.gserviceaccount.com).Create a connection
This section describes how to create a connection between Developer Connectand GitHub Enterprise. If you're using the Google Cloud console, then you can also startadding links to repositories as you finish setting up your connection.
To create a new GitHub Enterprise connection, select one of the following options:
Console
Initiate a connection by completing the following steps:
In the Google Cloud console, openDeveloper Connect.
Developer Connect displays theGit repositories page.
- If you see a list of source code management providers: Start configuring your first connection by selecting a source code management provider. ClickConnect on the GitHub Enterprise card.
If you see a table listing existing connections: Set the source code management provider by clickingCreate connection >GitHub Enterprise.
TheCreate Connection page opens.
ForRegion, choose aregionfor your connection resources.
- ForName, enter a name for your new connection.
Activate theEnable a data residency compliant connection checkboxto make this connection compliant withdata residency requirements.
GitHub connections created using the Google Cloud console aredata-residency compliant if you activate this checkbox when you createthe connection. When you do this, Developer Connectcreates a GitHub app
When you create a GitHub connections using Google Cloud CLI, thoseconnections are not data-residency compliant. All other connection typesare data-residency compliant.
- ForHost URL, enter the URL of the host you want to connect to.
ClickShow more to see optional configuration settings.
Optional: By default, Developer Connect can act as a proxy for Git calls to GitHub Enterprise.To disable this option, clear theEnable Developer Connect proxycheckbox.
ForNetwork type, selectPublic internet.
If you want to use a private network, seeConnect to GitHub Enterprise repositories hosted in a private network.
Optional: In theEncryption section, select aCMEK key toencrypt Secret Manager secrets that Developer Connectcreates.
ClickContinue.
A GitHub dialog appears, inviting you to create a GitHub app.
Following the prompts in GitHub, complete these tasks:
Input a name for your app.
Choose the organization where you want to install the app.
Select the repositories you want to grant access to.
The dialog closes.
Developer Connect fetches your private key from GitHub and storesit in your Google Cloud project as a Secret Managersecret. To view your secrets,list secrets in Secret Manager.
Once the connection is created, theLink repositories page appears.
Complete the following steps to link repositories to your connection:
In the list of available repositories, select the repositoriesyou want to use.
ClickOK.
ClickLink.
Your connection is added to theConnections page and your repositorylinks are added to theRepositories page in the Google Cloud console.You canadd more links to existing connections at any time.
If you're setting up Gemini Code Assist, continue the processby following the steps inConfigure and use Gemini Code Assist code customization.
gcloud
The following tasks require some actions in your web browser.
Initiate a connection by completing the following steps:
Run the
gcloud developer-connect connections createcommand to create a connection to GitHub Enterprise:gclouddeveloper-connectconnectionscreateCONNECTION_NAME\--location=REGION\--github-enterprise-config-host-uri=HOST_URI--git-proxy-config-enabledReplace the following:
You must create a GitHub app to manage connections with GitHub. Run thefollowing command to get URI for app setup:
gclouddeveloper-connectconnectionsdescribeCONNECTION_NAME\--location=REGIONReplace the following:
- CONNECTION_NAME: the name for yourconnection.
- REGION: theregion for your connection.
Developer Connect returns a link to complete the next stepsin a browser window. Copy this link.
Open the link in a web browser.
Sign in to your GitHub account if prompted to do so.
Following the prompts in GitHub, complete these tasks:
Input a name for your app.
Choose the organization where you want to install the app.
Select the repositories you want to grant access to.
The dialog closes.
Developer Connect fetches your private key from GitHub and storesit in your Google Cloud project as a Secret Managersecret. To view your secrets,list secrets in Secret Manager.
Verify the connection
Verify the creation of your GitHub connection by running the followingcommand:
gclouddeveloper-connectconnectionsdescribeCONNECTION_NAME\--location=REGIONWhere:
- CONNECTION_NAME: the name of your connection.
- REGION: the region for your connection.
Developer Connect returns a status in theinstallationState field. Ifthe value of this field isCOMPLETE, your app installation is done.Otherwise, Developer Connect returns a URI to return you toconfiguration in the browser.
Once your connection is completed, choose which repositories to link byfollowing the instructions inLink to repositories.
Add repository links to existing connections
Once you have established a connection to GitHub Enterprise, you can link torepositories. You can repeat these steps later to link additional repositoriesas needed.
To create repository links on an existing GitHub Enterprise connection, select one of thefollowing options:
Console
Open theRepositories page in the Google Cloud console.
ClickLink repository.
TheLink Git repositories pane opens.
In the connections list, choose a connection.
ClickContinue.
In the repositories list, select the repositories you want to link to.
ClickCreate.
Developer Connect creates the repository links and displays them inthe Google Cloud console.
gcloud
Run the following command:
gclouddeveloper-connectconnectionsgit-repository-linkscreateREPO_NAME\--clone-uri=REPO_URI\--connection=CONNECTION_NAME\--location=REGIONReplace the following:
- REPO_NAME: a name for your repository link.
- REPO_URI: the link to your repository.For example,
https://github.com/cloud-build/test-repo.git. - CONNECTION_NAME: the name of your connection.
- REGION: theregion for your connection.
Developer Connect creates the repository links.
To list linked repositories, run thedeveloper-connect connections git-repository-links list command.
If you're setting up Gemini Code Assist, continue the processby following the steps inConfigure and use Gemini Code Assist code customization.
Data sharing
Content from Google Cloud resources linked to this connection might betransferred to GitHub. This statement applies to all existing and futureresources utilizing this connection. To stop sharing information with GitHub,delete Developer Connect connections inthe Google Cloud console or gcloud CLI, andrevoke access in GitHub.
What's next
- Finish setting up Gemini Code Assist code customization.
- Learn how Gemini Code Assist helps you accelerate software development.
- Explore other integrations available through Developer Connect.
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 2026-02-19 UTC.