How to delete TFVC repository in Azure DevOps?

Viewed 5261

I need to delete a TFVC repository in Azure DevOps, but there seems to be no option to allow me to do it. The only TFVC repository (which I just created) seems to not even have a drop-down menu:

enter image description here

In contrast, in the same project, Git's repositories have a "Delete Repository" option in the drop-down menu:

enter image description here

Any ideas?

4 Answers

When a Team Project is created as a TFVC based project, the repository is part of the "key infrastructure". The repository cannot be deleted, but it can be destroyed.

tf vc destroy $/TestProject

The UI doesn't always completely understand what happened after you have executed this command, some parts will still show the repo due to the fact that the Team Project knows it should have a repository with the same name.

Once destroyed the repository cannot be recreated. This is a one-time action.

If you've made the move to Git, you can always perform a mirror clone and push the complete repository to a new Team Project. You can move the work items to another project as well. Build definitions and Release Definitions can be exported+imported.

It's usually not worth it though.

Ok just update for Azure DevOps

the command does work

"tf vc destroy $/TestProject"

it will remove the TSVC code but it still appears in list of options with message deleted. It is not ideal but its enough to stop people using it.

The project must have at least one repository. So, before start, make sure you have at least 2 repositories.

Steps from start:

  1. Connect with VS to the project
  2. Open Source Control
  3. Map the repository
  4. Get all the repository to local disc
  5. Select the repository and delete
  6. Check in

Confirm on DevOps that the repository no longer exists.

Related