Seit dem 17. Juni 2024 ist Cloud Source Repositories für Neukunden nicht mehr verfügbar. Wenn Ihre Organisation noch nicht Cloud Source Repositories verwendet hat, können Sie die API nicht aktivieren oder Cloud Source Repositories verwenden. Für neue Projekte, die nicht mit einer Organisation verbunden sind, kann die Cloud Source Repositories API nicht aktiviert werden. Organisationen, die Cloud Source Repositories vor dem 17. Juni 2024 verwendet haben, sind von dieser Änderung nicht betroffen.
Die Schritte zum Klonen eines Repositorys unterscheiden sich je nach Authentifizierungstyp (SSH, Google Cloud CLI oder manuell generierte Anmeldedaten).
Verwenden Sie auf Ihrem lokalen System Ihren Google Cloud -Nutzernamen und den vollständig qualifizierten SSH-Pfad zu Ihrem Repository, um das Repository zu klonen:
Wenn Sie zum ersten Mal mithilfe von SSH eine Verbindung zu Cloud Source Repositories herstellen, werden Sie aufgefordert, die Fingerabdrücke des SSH-Schlüssels für den Remote-Host zu bestätigen. Der Hostname für den Repository-Dienst lautet source.developers.google.com. Die Fingerabdrücke sind:
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 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."]]