3

We have a TFS Server, but whenever I create a file and afterwards try to undo the addition, TFS doesn't delete the local version. I already tried to reassign the workspace, completely delete the workspace and re-download, check the workspace bindings and so on, but nothing worked so far.

Giulio Vian
  • 8,248
  • 2
  • 33
  • 41
  • Oh, might be relevant: Do you delete the file in VS or in the TFS web interface? – Mafii Jul 16 '18 at 09:11
  • Sorry for the misunderstanding. I deleted the local copy of my files and the configuration of the workspace. Since I don't have permissions on the TFS I can't change anything admin related. – WhoAteMyDog Jul 16 '18 at 09:15
  • Okay, have you tried what I've described - both deleting your workspace and all your local files, then getting them again? Or have you already pushed the file to TFSVC? – Mafii Jul 16 '18 at 09:21
  • Yes, I already tried to delete both. – WhoAteMyDog Jul 16 '18 at 09:34
  • Can you state in detail the sequence of actions? What "try to undo the addition" means? – Giulio Vian Jul 16 '18 at 14:26
  • Yeah sure. I'm adding a new file to the solution, which is correctly recognized. But when I try to undo the file creation, the file is removed from source control, but not from my local drive. Other projects are working fine when I undo the creation they're removed from my local drive. – WhoAteMyDog Jul 17 '18 at 06:05
  • @WhoAteMyDog Are you working on server work space or local work space? And for other projects which kind of work space are they using? – PatrickLu-MSFT Jul 17 '18 at 07:51
  • @PatrickLu-MSFT All of them are server workspaces. – WhoAteMyDog Jul 17 '18 at 08:20

4 Answers4

1

You may mix up something. For TFVC source control, when you are trying to "add" files to TFS, it creates an entry in the database just waiting for the files. Instead, undo your "add."

Right click on any source file in the source explorer, and choose Undo Pending Changes. Click OK to undo those changes.

That will clean up everything in the TFS database. However it will keep the local files, since they are actually not checked in TFS server and do not have any mapping relationship. Operation in the server side definitely will not affect local files.

If you want to make sure your local folders and server folders are the same, you could also consider to use reconcile differences between two folders, take a look at this link.

PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62
0

Now I know this might not be what you want to hear, but you most directly solve this problem by switching your source control system to git. Git doesn't do half assed things. Either it's in the repo, or it isn't.


Answer:

You said you deleted the workspace? Delete the workspace, and then manually delete all files from your disk. Then recreate the workspace, and get the latest version. Just deleting the workspace will not delete your local files. You can also just manually delete the file you want to get rid of from you computer, without deleting your workspace.

Mafii
  • 7,227
  • 1
  • 35
  • 55
0

This is expected behaviour if you use TFVC as your source control system. I would guess that the rationale is that just because you have decided not to commit the file to you repository, you might still need the file locally.

As @Mafii mentions in his answer it would work differently with git.

Tore Østergaard
  • 4,362
  • 3
  • 27
  • 43
0

To change or remove the workspace mapping, Go to File -> Source Control -> Advanced -> Workspaces -> Select the workspace name in the 'manage Workspaces' -> Edit. Change the Local Folder the path.

If you want to remove, use remove button instead edit.

The below link will helpful: Delete Local Folder in TFS And TFS - Latest field still showing "Yes" after deleting local files

S.Maneesh
  • 60
  • 6