A partir del 17 de junio de 2024, Cloud Source Repositories no estará disponible para clientes nuevos. Si tu organización no usó Cloud Source Repositories antes, no puedes habilitar la API ni usar Cloud Source Repositories. Los proyectos nuevos que no estén conectados a una organización no podrán habilitar la API de Cloud Source Repositories. Las organizaciones que usaron Cloud Source Repositories antes del 17 de junio de 2024 no se verán afectadas por este cambio.
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Puedes usar Cloud Source Repositories para crear un nuevo repositorio vacío. Crear un repositorio es útil cuando deseas iniciar un proyecto o crear una copia de seguridad de un repositorio de Git con Cloud Source Repositories.
Antes de comenzar
Sign in to your Google Cloud account. If you're new to
Google Cloud,
create an account to evaluate how our products perform in
real-world scenarios. New customers also get $300 in free credits to
run, test, and deploy workloads.
In the Google Cloud console, on the project selector page,
select or create a Google Cloud project.
Selecciona Crear repositorio nuevo y haz clic en Continuar.
Se abrirá la página Crear repositorio nuevo.
En el campo Nombre del repositorio, escribe un nombre para el nuevo repositorio.
Ten en cuenta que los nombres All-Users y All-Projects son nombres restringidos y no se pueden usar.
En la lista desplegable Proyecto, selecciona el proyecto Google Cloudal que pertenece el repositorio.
[[["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)"],[],[],null,["# Creating an empty repository\n\nYou can use Cloud Source Repositories to create a new, empty repository. Creating a\nrepository is useful when you want to start a project or back up a Git\nrepository using Cloud Source Repositories.\n\nBefore you begin\n----------------\n\n- Sign in to your Google Cloud account. If you're new to Google Cloud, [create an account](https://console.cloud.google.com/freetrial) to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.\n- In the Google Cloud console, on the project selector page,\n select or create a Google Cloud project.\n\n | **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.\n\n [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n-\n [Verify that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project).\n\n- In the Google Cloud console, on the project selector page,\n select or create a Google Cloud project.\n\n | **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.\n\n [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n-\n [Verify that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project).\n\n1.\n [Install](/sdk/docs/install) the Google Cloud CLI.\n\n2. If you're using an external identity provider (IdP), you must first\n [sign in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n\n3.\n To [initialize](/sdk/docs/initializing) the gcloud CLI, run the following command:\n\n ```bash\n gcloud init\n ```\n4. [Verify that you have the latest version of Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git).\n5. If you have not configured your user credentials in Git, follow the [first time setup instructions.](https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup)\n6. Enable the Cloud Source Repositories API.\n7. [Enable the Cloud Source Repositories API](https://console.cloud.google.com/flows/enableapi?apiid=sourcerepo.googleapis.com&redirect=https://cloud.google.com/source-repositories/docs/creating-an-empty-repository)\n\nCreate a new repository\n-----------------------\n\nYou can create a repository by using either the Google Cloud console or the `gcloud`\ncommand-line tool. \n\n### Console\n\n1. In the Google Cloud console, open Cloud Source Repositories.\n\n [Open Cloud Source Repositories](https://source.cloud.google.com/repos)\n2. Click **Add repository**.\n\n The **Add a repository** page opens.\n3. Select **Create new repository** and click **Continue**.\n\n The **Create new repository** page opens.\n4. In the **Repository name** field, type a name for the new repository.\n Note that the names `All-Users` and `All-Projects` are restricted names\n and cannot be used.\n\n5. In the **Project** drop-down list, select the Google Cloud\n project the repository belongs to.\n\n To [create a new Google Cloud project](#create_a_project), click\n **Create project**.\n6. Click **Create**.\n\n Your repository is created, and the **Add code to your repository** page\n opens. This page provides instructions on how to\n [clone the repository to your local machine](/source-repositories/docs/cloning-repositories)\n or\n [push code from an existing repository](/source-repositories/docs/pushing-code-from-a-repository)\n based on your authentication type.\n\n### gcloud\n\n1. From the command line, call:\n\n gcloud init\n gcloud source repos create [REPO_NAME]\n\n Where `[REPO_NAME]` is the name for your repository. Note that the names\n `All-Users` and `All-Projects` are restricted names and cannot be used.\n\nCreate a project\n----------------\n\nAll repositories must belong to a Google Cloud project. If you don't have\na Google Cloud project, you can create one by following these steps.\n\n1. On the **Create new repository** [page](#create_a_new_repository), click\n **Create project**.\n\n The **Create Cloud project** dialog opens.\n2. In the **Project name** field, type a name for the Google Cloud\n project.\n\n3. In the **Project ID** field, either accept the generated project ID or click\n **Edit Project ID** to enter a different one.\n\n | **Note:** Your Google Cloud project ID must be unique across Google Cloud.\n4. In the **Billing Account** drop-down list, select a billing account.\n\n To create a billing account, click **Create billing account**.\n5. Click **Create**.\n\nYou can continue [creating a new repository](#create_a_new_repository).\n\nWhat's next\n-----------\n\nNow that you have a repository in Cloud Source Repositories, you can now add\nyour code, which might involve either of these processes:\n\n- [Cloning your new repository](/source-repositories/docs/cloning-repositories) to your local machine.\n- [Pushing code from an existing repository](/source-repositories/docs/pushing-code-from-a-repository) on your local machine."]]