Azure DevOps Services | Azure DevOps Server 2022 - Azure DevOps Server 2019
Remove unused Git repos from your project when they are no longer needed. The steps in this article show how to delete a Git repo from your Azure DevOps project. If you want to delete the entire project, see Delete a project.
Important
You cannot remove a repo if it is the only Git repo in the Azure DevOps project. If you need to delete the only Git repo in a project, create a new Git repo first, then delete the repo.
Azure DevOps organization URL. You can configure the default organization by using az devops configure -d organization=<ORG_URL>. Required if not configured as default or picked up via git config. Example: https://dev.azure.com/MyOrganizationName/.
project, p
Name or ID of the project. You can configure the default project using az devops configure -d project=<NAME_OR_ID>. Required if not configured as default or picked up via git config.
subscription
Name or ID of subscription. You can configure the default subscription using az account set -s <NAME_OR_ID>.
yes
Don't prompt for confirmation.
Example
The following command deletes the Fabrikam repository, ID 0d58f562-4a10-495d-94d7-7ac61a22d7cc. This example uses the following default configuration: az devops configure --defaults organization=https://dev.azure.com/fabrikamprime project="Fabrikam Fiber".
az repos delete --id 0d58f562-4a10-495d-94d7-7ac61a22d7cc
Are you sure you want to delete this repository? (y/n): y
Azure DevOps CLI commands aren't supported for Azure DevOps Server.