Alex Rivera | Logout

How to delete from TFS all files that are deleted from working copy?

Asked 2012-09-05T06:44:28.233
8

I've manually deleted some files/folders in my workspace. How do I pend deletes for those items in my TFS workspace and get those deletes to be reflected in the repository (via command line or programmatic API).

Edit
Report

1 Answer

5

Deleting items within your working folders will not reflect the delete within source control. To delete the items from source control do the following:

  1. Delete it from source control ui, do this by right clicking the item and deleting then committing the change.

  2. Open VS Command line and run the tf properties command, example: tf properties /s:TFSServerCollection "$/FilePath/Filename.jpg" This will let you retrieve the delete ID, for this example lets say the delete id 12345

  3. In the same VS Command line window, run tf destroy command, example: tf destroy /s:TFSServerCollection "$/FilePath/Filename.jpg";x12345

Don't forget to add the 'x' before the delete ID. Press enter and it will prompt you if you want to delete the item. Say yes, and then press enter. Just be careful as tf destroy complete removed the item and/or folder from source control including it's history.

answered 2012-09-05T14:48:36.463

Your Answer