Edit

Share via


Delete a Git repo from your project

Azure DevOps Services | Azure DevOps Server | Azure DevOps Server 2022

Remove unused Git repos from your project when they're 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

  • Deleted Git repositories are soft-deleted and remain in a recycle bin for 30 days. During this period, you can restore a deleted repository by using the Repositories - Restore Repository From Recycle Bin REST API. After 30 days, repositories are permanently deleted and can't be recovered.
  • You can't remove a repo if it's 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.

Prerequisites

Category Requirements
Permissions Delete Repository permission.

Note

To use the Azure DevOps CLI az repos delete command, see Get started with Azure DevOps CLI.

Delete a Git repo from the web

Tip

Instead of deleting a repo, consider renaming it with an _archived prefix and locking its default branch. This approach retires the repo from active use while preserving commit history, pull request records, and existing links.

  1. Sign in to your project (https://dev.azure.com/{Your-Organization}/{Your-Project}).

  2. Select Project settings.

  3. Select Repositories > the name of the repository from the Repositories list > ... more actions > Delete.

    Screenshot showing the Delete repository action.

  4. To confirm the deletion of the repository, enter the repo's name and select Delete.

    Screenshot showing the Delete repository confirmation dialog.

    The repository is removed from the Repositories list. It remains in the recycle bin for 30 days before permanent deletion.