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.
Nutzern Zugriff auf Repositories und Projekte gewähren
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
In diesem Thema wird beschrieben, wie Sie Nutzern Zugriff auf Repositories und Projekte gewähren und welche Aktionen diese Nutzer ausführen können. Beispiele für Nutzeraktionen:
Berechtigungen zum Übertragen von Commits per Push erteilen
Nutzer mit dieser Berechtigungsstufe können Änderungen an ein Repository per Push übertragen. Sie können auch alle Aktionen ausführen, die unter Repositories ansehen beschrieben werden.
Wenn diese Berechtigung auf Projektebene erteilt wird, können Nutzer Änderungen an allen Repositories in diesem Projekt vornehmen.
Push-Berechtigungen für ein Repository erteilen
Console
Öffnen Sie in der Google Cloud Console auf dem Tab Meine Quelle Cloud Source Repositories.
Klicken Sie auf den Namen eines Repositorys.
Die Ansicht Dateien wird geöffnet.
Klicken Sie auf Einstellungensettings.
Die Seite Allgemeine Einstellungen wird geöffnet.
Klicken Sie auf Berechtigungen.
Die Seite Berechtigungen wird geöffnet.
Geben Sie im Feld Mitglieder die E-Mail-Adresse des Nutzers ein.
Wählen Sie in der Drop-down-Liste RolleQuell-Repository > Quell-Repository-Schreiber aus.
[[["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,["# Granting user access to repositories and projects\n\nThis topic describes how you can provide users access to repositories and\nprojects, and what actions those users can take. Examples of user actions\ninclude the following:\n\n- Listing repositories\n- Creating new repositories\n- Updating repositories\n\nFor a complete list of actions, see\n[Roles and permissions matrix](/source-repositories/docs/configure-access-control#roles_and_permissions_matrix).\n\nGrant permissions to view repositories\n--------------------------------------\n\nUsers with this level of permissions can view the contents of a repository. They\ncan also clone and fetch the repository.\n\nIf granted this permission at the project level, users can view all repositories\nfor that project.\n\n### Grant viewing permissions for a repository\n\n### Console\n\n1. In the Google Cloud console, open Cloud Source Repositories in the [My source](https://source.cloud.google.com/) view tab\n\n2. Click the name of a repository.\n\n The **Files** view opens.\n3. Click\n **Settings** *settings*.\n\n The **General settings** page opens.\n4. Click **Permissions**.\n\n The **Permissions** page opens.\n5. In the **Members** field, enter the user's email address.\n\n6. In the **Role** drop-down list, select\n **Source repository \\\u003e Source Repository Reader**.\n\n7. Click **Add**.\n\n### Command line\n\n1. Open a terminal window.\n\n2. Enter the following command:\n\n gcloud source repos set-iam-policy [REPO_NAME] [POLICY_FILE] [GCLOUD_WIDE_FLAG ...]\n\n Where:\n - `[REPO_NAME]` is the name of the repository.\n - `[POLICY_FILE]` is the JSON or YAML file with the Identity and Access Management policy.\n\nFor more information on this command, see\n[gcloud source repos set-iam-policy](/sdk/gcloud/reference/source/repos/set-iam-policy).\n\n### Grant viewing permissions across a project\n\n### Console\n\n1. In the Google Cloud console, open Cloud Source Repositories in the [My source](https://source.cloud.google.com/) view tab\n\n2. Click the name of a Google Cloud project ID for a specific repository.\n\n The page displays a list of all repositories for that project.\n3. Click\n **Settings** *settings*.\n\n The **General settings** page opens.\n4. Click **Permissions**.\n\n The **Permissions** page opens.\n5. In the **Members** field, enter the user's email address.\n\n6. In the **Role** drop-down list, select\n **Source repository \\\u003e Source Repository Reader**.\n\n7. Click **Add**.\n\n### Command line\n\n1. Open a terminal window.\n\n2. Enter the following command:\n\n gcloud projects add-iam-policy-binding [PROJECT_ID] --member=[MEMBER] \\\n --role=[ROLE] [GCLOUD_WIDE_FLAG ...]\n\n Where:\n - `[PROJECT_ID]` is the ID for your Google Cloud project.\n - `[MEMBER]` is the user you want to add.\n - `[ROLE]` is the IAM role you want to assign.\n\nFor more information on this command, see\n[gcloud projects add-iam-policy-binding](/sdk/gcloud/reference/projects/add-iam-policy-binding).\n\nGrant permissions to push commits\n---------------------------------\n\nUsers with this level of permissions can push changes to a repository. They can\nalso perform all the actions described in\n[Viewing repositories](#viewing_repositories).\n\nIf granted this permission at the project level, users can push changes\nto all repositories in that project.\n\n### Grant push permissions for a repository\n\n### Console\n\n1. In the Google Cloud console, open Cloud Source Repositories in the [My source](https://source.cloud.google.com/) view tab\n\n2. Click the name of a repository.\n\n The **Files** view opens.\n3. Click\n **Settings** *settings*.\n\n The **General settings** page opens.\n4. Click **Permissions**.\n\n The **Permissions** page opens.\n5. In the **Members** field, enter the user's email address.\n\n6. In the **Role** drop-down list, select\n **Source repository \\\u003e Source Repository Writer**.\n\n7. Click **Add**.\n\n### Command line\n\n1. Open a terminal window.\n\n2. Enter the following command:\n\n gcloud source repos set-iam-policy [REPO_NAME] [POLICY_FILE] [GCLOUD_WIDE_FLAG ...]\n\n Where:\n - `[REPO_NAME]` is the name of the repository.\n - `[POLICY_FILE]` is the JSON or YAML file with the IAM policy.\n\nFor more information on this command, see\n[gcloud source repos set-iam-policy](/sdk/gcloud/reference/source/repos/set-iam-policy).\n\n### Grant push permissions for a project\n\n### Console\n\n1. In the Google Cloud console, open Cloud Source Repositories in the [My source](https://source.cloud.google.com/) view tab\n\n2. Click the name of a Google Cloud project ID for a specific\n repository.\n\n The page displays a list of all repositories for that project.\n3. Click\n **Settings** *settings*.\n\n The **General settings** page opens.\n4. Click **Permissions**.\n\n The **Permissions** page opens.\n5. In the **Members** field, enter the user's email address .\n\n6. In the **Role** drop-down list, select\n **Source Repository \\\u003e Source Repository Writer**.\n\n7. Click **Add**.\n\n### Command line\n\n1. Open a terminal window.\n\n2. Enter the following command:\n\n gcloud projects add-iam-policy-binding [PROJECT_ID] --member=[MEMBER] \\\n --role=[ROLE] [GCLOUD_WIDE_FLAG ...]\n\n Where:\n - `[PROJECT_ID]` is the ID for your Google Cloud project.\n - `[MEMBER]` is the user you want to add.\n - `[ROLE]` is the IAM role you want to assign.\n\nFor more information on this command, see\n[gcloud projects add-iam-policy-binding](/sdk/gcloud/reference/projects/add-iam-policy-binding).\n\nGrant permissions to create and delete repositories\n---------------------------------------------------\n\n\u003cbr /\u003e\n\nIf granted this permission at the project level, users can create, update, and\ndelete repositories for the entire project.\n\n1. In the Google Cloud console, open Cloud Source Repositories in the [My source](https://source.cloud.google.com/) view tab\n\n2. Click the name of a Google Cloud project ID for a specific repository.\n\n The page displays a list of all repositories for that project.\n3. Click\n **Settings** *settings*.\n\n The **General settings** page opens.\n4. Click **Permissions**.\n\n The **Permissions** page opens.\n5. In the **Members** field, enter the user's email address.\n\n6. In the **Role** drop-down list, select\n **Source repository \\\u003e Source Repository Administrator**.\n\n7. Click **Add**.\n\nRemove a user's access\n----------------------\n\nThere may be cases where you need to remove a user's access to a repository or\nproject.\n\n### Remove access to a repository\n\n1. In the Google Cloud console, open Cloud Source Repositories in the [My source](https://source.cloud.google.com/) view tab\n\n2. Click on the name of a repository.\n\n The **Files** view opens.\n3. Click\n **Settings** *settings*.\n\n The **General settings** page opens.\n4. Click **Permissions**.\n\n5. Locate the role you want to remove, and then click\n **Delete** *delete*\n for that role.\n\n A confirmation dialog opens.\n6. Click **Remove**.\n\n### Remove access to a project\n\n1. In the Google Cloud console, open Cloud Source Repositories in the [My source](https://source.cloud.google.com/) view tab\n\n2. Click the name of a Google Cloud project ID for a specific repository.\n\n The page displays a list of all repositories for that project.\n3. Click\n **Settings** *settings*.\n\n The **General settings** page opens.\n4. Click **Permissions**.\n\n The **Permissions** page opens.\n5. Locate the role you want to remove, and then click\n **Delete** *delete*\n for that role.\n\n A confirmation dialog opens.\n6. Click **Remove**.\n\nWhat's next\n-----------\n\n- Learn more about\n [Cloud Source Repositories and access control](/source-repositories/docs/configure-access-control).\n\n- Learn more about [IAM](/iam/docs)."]]