En la parte superior de la página, selecciona la pestaña 2ª gen.
En el selector de proyectos de la barra superior, selecciona tu proyecto Google Cloud .
Haz clic en Vincular repositorio para vincular repositorios desde tu conexión.
Verás el panel Vincular repositorio.
En el panel Vincular repositorio, ingresa la siguiente información:
Conexión: Selecciona una conexión en el menú desplegable.
Repositorio: Selecciona un repositorio para vincularlo a tu conexión.
Nombre del repositorio: Ingresa un nombre para tu repositorio.
Generados: Selecciona esta opción para que Cloud Build genere automáticamente nombres de repositorios en tu nombre para los repositorios seleccionados.
Manual: Selecciona esta opción para especificar manualmente los nombres de los repositorios seleccionados.
Si seleccionas Manual, puedes modificar los nombres de los repositorios seleccionados en la sección Nombres de repositorios.
Haz clic en Vincular para vincular tu repositorio a la conexión.
Ahora vinculaste correctamente tu repositorio de GitLab Enterprise Edition a tu conexión.
gcloud
Para agregar un repositorio de GitLab Enterprise Edition a tu conexión, ingresa el siguiente comando:
Aprende a compilar e implementar tus cargas de trabajo en Google Cloud con componentes de CI/CD administrados por Google en tu canalización de GitLab. Consulta GitLab en Google Cloud.
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-04 (UTC)"],[[["\u003cp\u003eThis guide outlines the process of connecting a GitLab Enterprise Edition repository to Cloud Build for automated builds.\u003c/p\u003e\n"],["\u003cp\u003eBefore connecting a repository, users must enable the Cloud Build and Secret Manager APIs, and connect a GitLab Enterprise Edition host.\u003c/p\u003e\n"],["\u003cp\u003eThe connection process can be completed using the Google Cloud console, the gcloud command-line tool, or Terraform configurations.\u003c/p\u003e\n"],["\u003cp\u003eWhen linking repositories in the console, users can choose to have Cloud Build automatically generate repository names or manually define them.\u003c/p\u003e\n"],["\u003cp\u003eAfter linking, users can proceed to configure builds from the connected GitLab Enterprise Edition repository and other associated configurations.\u003c/p\u003e\n"]]],[],null,["# Connect to a GitLab Enterprise Edition repository\n\nThis page explains how to connect a [GitLab Enterprise Edition](https://about.gitlab.com/enterprise/) repository to Cloud Build. To learn more about Cloud Build repositories, see [Cloud Build repositories](/build/docs/repositories).\n\nBefore you begin\n----------------\n\n-\n\n\n Enable the Cloud Build and Secret Manager APIs.\n\n\n [Enable the APIs](https://console.cloud.google.com/flows/enableapi?apiid=cloudbuild.googleapis.com,secretmanager.googleapis.com&redirect=https://cloud.google.com/build/docs/automating-builds/gitlab/connect-repo-gitlab-enterprise-edition)\n\n\u003c!-- --\u003e\n\n- Follow the instructions to [connect a GitLab Enterprise Edition host](/build/docs/automating-builds/gitlab/connect-host-gitlab-enterprise-edition) before connecting repositories.\n\nConnect to a GitLab Enterprise Edition repository\n-------------------------------------------------\n\n### Console\n\n1. Open the **Repositories** page in the Google Cloud console.\n\n [Open the Repositories page](https://console.cloud.google.com/cloud-build/repositories)\n\n You see the **Repositories** page.\n2. At the top of the page, select the **2nd gen** tab.\n\n3. In the project selector in the top bar, select your Google Cloud project.\n\n4. Click **Link repository** to link repositories from your connection.\n\n You see the **Link repository** panel.\n5. In the **Link repository** panel, enter the following information:\n\n 1. **Connection**: Select a connection from the drop-down menu.\n 2. **Repository**: Select a repository to link to your connection.\n\n 3. **Repository Name**: Enter a name for your repository.\n\n 1. **Generated**: Select this option for Cloud Build to automatically generated repository names on your behalf for selected repositories.\n 2. **Manual**: Select this option to manually specify names for your\n selected repositories.\n\n If you select **Manual** , you can modify the names for your\n selected repositories in the **Repository names** section.\n6. Click **Link** to link your repository to your connection.\n\nYou have now successfully linked your GitLab Enterprise Edition repository to your connection.\n\n### gcloud\n\nTo add a GitLab Enterprise Edition repository to your connection, enter the following\ncommand: \n\n gcloud builds repositories create \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eREPO_NAME\u003c/span\u003e\u003c/var\u003e \\\n --remote-uri=\u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eREPO_URI\u003c/span\u003e\u003c/var\u003e \\\n --connection=\u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eCONNECTION_NAME\u003c/span\u003e\u003c/var\u003e --region=\u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eREGION\u003c/span\u003e\u003c/var\u003e\n\nWhere:\n\n- \u003cvar translate=\"no\"\u003eREPO_NAME\u003c/var\u003e is the name of your repository.\n- \u003cvar translate=\"no\"\u003eREPO_URI\u003c/var\u003e is the link to your GitLab Enterprise Edition repository. For example, https://`gitlab-enterprise.com/myuser/myrepo.git`.\n- \u003cvar translate=\"no\"\u003eCONNECTION_NAME\u003c/var\u003e is the name given to the GitLab Enterprise Edition connection created in Cloud Build from [Connect to a GitLab Enterprise Edition host](/build/docs/automating-builds/gitlab/connect-host-gitlab-enterprise-edition#connecting_to_a_gitlab_enterprise_edition_host).\n- \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e is the [region](/build/docs/locations) for your connection.\n\nYou have now linked a repository to your GitLab Enterprise Edition connection.\n\n### Terraform\n\nTo add a GitLab Enterprise Edition repository to your connection, add the following\ncode snippet to your Terraform configuration: \n\n resource \"google_cloudbuildv2_repository\" \"my-repository\" {\n project = \"\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e\"\n name = \"\u003cvar translate=\"no\"\u003eREPO_NAME\u003c/var\u003e\"\n location = :\u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-err\"\u003eREGION\u003c/span\u003e\u003c/var\u003e\"\n parent_connection = google_cloudbuildv2_connection.my-connection.name\n remote_uri = \"\u003cvar translate=\"no\"\u003eREPO_URI\u003c/var\u003e'\n }\n\nWhere:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e is your Google Cloud project ID.\n- \u003cvar translate=\"no\"\u003eREPO_NAME\u003c/var\u003e is the name of your GitLab Enterprise Edition repo.\n- \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e is the [region](/build/docs/locations) for your connection.\n- \u003cvar translate=\"no\"\u003eREPO_URI\u003c/var\u003e is the remote URI of your repository. For example, `https://gitlab-enterprise.com/myuser/myrepo.git`.\n\nYou have now linked a repository to your GitLab Enterprise Edition connection.\n\nWhat's next\n-----------\n\n- Learn how to [build repositories from GitLab Enterprise Edition](/build/docs/automating-builds/gitlab/build-repos-from-gitlab-enterprise-edition).\n- Learn how to [build repositories from GitLab Enterprise Edition in a private network](/build/docs/automating-builds/gitlab/build-repos-from-gitlab-enterprise-edition-private-network).\n- Learn how to build and deploy your workloads to Google Cloud using Google-managed CI/CD components in your GitLab pipeline. See [GitLab on Google Cloud](/docs/gitlab)."]]