A partir de 17 de junho de 2024, o Cloud Source Repositories não vai mais estar disponível para novos clientes. Se a sua organização ainda não tiver usado o Cloud Source Repositories, não será possível ativar a API nem usar o Cloud Source Repositories. Novos projetos não conectados a uma organização não poderão ativar a API Cloud Source Repositories. As organizações que usaram o Cloud Source Repositories antes de 17 de junho de 2024 não serão afetadas por essa mudança.
Na primeira vez que você se conectar ao Cloud Source Repositories usando SSH, será solicitado que você confirme as impressões digitais da chave SSH para o host remoto. O nome do host para o serviço de repositório é source.developers.google.com. As impressões digitais são:
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-08-11 UTC."],[],[],null,["# Cloning a repository\n\nThis topic describes how to clone the contents of a repository from\nCloud Source Repositories to your local machine.\n\nBefore you begin\n----------------\n\nThe following is required to clone the contents of a repository:\n\n- You must have\n [authentication on your local system](/source-repositories/docs/authentication).\n\n The steps to clone a repository vary depending on your authentication type\n (SSH, Google Cloud CLI, or manually generated credentials).\n- You must have\n [a repository in Cloud Source Repositories](/source-repositories/docs/creating-an-empty-repository).\n\n- You must have\n [permissions to interact with the repository](/source-repositories/docs/configure-access-control).\n\n- The repository to be cloned cannot have a restricted name such as `All-Users`\n or `All-Projects`.\n\nClone using SSH\n---------------\n\nIf you're not using manually generated credentials or the gcloud CLI,\nyou can clone a repository by using SSH. \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. Hold your pointer over the repository you want to clone.\n\n3. Click **Clone** add_box.\n\n A dialog with authentication options opens.\n4. Click the **SSH authentication** tab and follow the\n instructions to clone your repository.\n\n### gcloud\n\n1. Ensure that you're\n [authenticated with SSH](/source-repositories/docs/authentication#ssh)\n on your local machine.\n\n2. On your local system, use your Google Cloud username\n and the fully qualified SSH path to your repository to clone your\n repository:\n\n git clone ssh://[EMAIL]@source.developers.google.com:2022/p/[PROJECT_ID]/r/[REPO_NAME]\n\n Where:\n - `[EMAIL]` is your Google Cloud username.\n - `[PROJECT_ID]` is the ID of the Google Cloud project where the repository is located.\n - `[REPO_NAME]` is the name of the repository.\n\n For example: \n\n git clone ssh://user@gmail.com@source.developers.google.com:2022/p/example-project/r/test-repo\n\nThe first time you connect to Cloud Source Repositories by using SSH,\nyou're asked to confirm the SSH key fingerprints for the remote host. The\nhostname for the repository service is `source.developers.google.com`. The\nfingerprints are: \n\n none\n SHA256:AGvEpqYNMqsRNIviwyk4J4HM0lEylomDBKOWZsBn434\n MD5:74:84:6c:08:d5:b5:54:68:19:da:2a:8e:4c:5b:d3:0d\n\nClone using the gcloud CLI\n--------------------------\n\nIf you're not using SSH or manually generated credentials, you can clone a\nrepository by using the gcloud CLI. \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. Hold your pointer over the repository you want to clone.\n\n3. Click **Clone** add_box.\n\n A dialog with authentication options opens.\n4. Click the **Google Cloud SDK** tab and follow the instructions to\n clone your repository.\n\n### gcloud\n\n1. Ensure that\n [the gcloud CLI is installed](/source-repositories/docs/authentication#authenticate-using-the-cloud-sdk)\n on your local system.\n\n2. In a terminal window, provide your authentication credentials:\n\n gcloud init\n\n3. Clone your repository:\n\n gcloud source repos clone [REPO_NAME] --project=[PROJECT_NAME]\n\n Where:\n - `[REPO_NAME]` is the name of your repository.\n - `[PROJECT_NAME]` is the name of your Google Cloud project.\n\n For example: \n\n gcloud source repos clone test-repo --project=example-project\n\nClone using manually generated credentials\n------------------------------------------\n\nIf you're not using SSH or the gcloud CLI, you can clone a repository\nby using manually generated credentials. \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. Hold your pointer over the repository you want to clone.\n\n3. Click **Clone** add_box.\n\n A dialog with authentication options opens.\n4. Click the **Manually generated credentials** tab and follow the\n instructions to clone your repository.\n\n### gcloud\n\n1. Ensure that you have\n [generated and stored your Git credentials](/source-repositories/docs/authentication#manually-generated-credentials).\n\n2. In a terminal window, enter the following command:\n\n git clone https://source.developers.google.com/p/[PROJECT_NAME]/r/[REPO_NAME]\n\n Where:\n - `[PROJECT_NAME]` is the name of your project.\n - `[REPO_NAME]` is the name of your repository."]]