Delete a repository

Required roles

To get the permissions that you need to delete a repository, ask your administrator to grant you the following IAM roles:

For more information about granting roles, seeManage access to projects, folders, and organizations.

You might also be able to get the required permissions throughcustom roles or otherpredefined roles.

For information on granting Secure Source Manager roles,seeAccess control with IAM andGrant users instance access.

Delete a repository

You can delete a repository using the gcloud, web interface, orAPI.

Web interface

  1. To access the Secure Source Manager instance through its web interface, copy the following URLinto your browser address bar.

    INSTANCE_ID-PROJECT_NUMBER.LOCATION.sourcemanager.dev

    Replace the following:

    • INSTANCE_ID with the instance name.
    • PROJECT_NUMBER with the instance's Google Cloud project number. For information on identifying projects, seeIdentifying projects.
    • LOCATION with the instance's region.

  2. In the list of repositories, select the repository that you want to delete.
  3. ClickSettings.
  4. InRepository Settings, clickDelete This Repository.

gcloud

To delete a repository, run the following command:

gcloudsource-managerreposdeleteREPOSITORY_ID--region=REGION--project=PROJECT_ID

Replace the following:

  • REPOSITORY_ID: The ID of the repository you want to delete.
  • REGION: The region where the Secure Source Managerinstance is located (for example,us-central1).
  • PROJECT_ID: The project ID where theSecure Source Manager instance is located.

API

To delete your repository and all associated data, use the following HTTPmethod and URL.

Before using any of the request data, make the following replacements:

  • PROJECT_ID: theproject ID of the Google Cloud project where Secure Source Manager is running.
  • LOCATION: the region where your instance is located. For information on supported locations, seeLocations.
  • REPOSITORY_ID: the repository ID.

HTTP method and URL:

DELETE https://securesourcemanager.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/repositories/REPOSITORY_ID

To send your request, expand one of these options:

curl (Linux, macOS, or Cloud Shell)

Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login , or by usingCloud Shell, which automatically logs you into thegcloud CLI . You can check the currently active account by runninggcloud auth list.

Execute the following command:

curl -X DELETE \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://securesourcemanager.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/repositories/REPOSITORY_ID"

PowerShell (Windows)

Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login . You can check the currently active account by runninggcloud auth list.

Execute the following command:

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
-Method DELETE `
-Headers $headers `
-Uri "https://securesourcemanager.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/repositories/REPOSITORY_ID" | Select-Object -Expand Content

You should receive a JSON response similar to the following:

"name":"operations/cc3ea26c-9b57-11ed-be0a-2e3b5910efef","metadata":{"@type":"type.googleapis.com/google.cloud.securesourcemanager.v1.OperationMetadata","createTime":"2023-01-23T19:54:49.904779921Z","endTime":"2023-01-23T19:54:50.947030402Z","target":"projects/my-project/locations/us-central1/repositories/my-repo","verb":"delete","apiVersion":"v1"},"done":true,"response":{"@type":"type.googleapis.com/google.protobuf.Empty"}```

What's next

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-19 UTC.