Evren Kuzucuoglu
Evren Kuzucuoglu

Reputation: 3885

Team Foundation Server: how to delete local files which are not in version control?

I am trying to perform a complicated merge between branches of the same solution. We use Team Foundation Server, but I would prefer compare folders locally with WinMerge instead of relying on TFS directly to tell me what changed. The problem is, there are a lot of files that are not in source control which pollute the WinMerge folder comparison: bin, obj, static code analysis files, remaining projects that were created locally but discarded and never deleted...

I could delete local folders and force get from source control to clean it, but I'm connected to the source control through a slow VPN and it could take a while; or I could also manually delete whichever files I think are duplicate, but that is too empirical to be exhaustive.

So here's my question: is there any tfs command to clean local folders?

Upvotes: 19

Views: 6507

Answers (4)

yakya
yakya

Reputation: 5210

For Visual Studio 2017, there is no Power Tools but the good news is that most of the features are moved into TFS 2017. Therefore, you can simply use the following without installing any tools.

tf vc reconcile /clean /recursive .

Upvotes: 4

TTT
TTT

Reputation: 28944

In 2015 tfpt has since been deprecated. After downloading the 2015 TFS Power Tools the new command is:

tf reconcile /clean /recursive .

The ending dot assumes your Developer Command Prompt is sitting at the root directory in your workspace you wish to start from, and /recursive assumes you want to include all subdirectories.

When you run the command it will pop up a preview of all changes it will make, and give you the opportunity to cherry-pick which ones you'd like to keep, if not all.

Note: pending files will not be included in the results, which is usually what you want. If you want to remove them as well, you should undo your pending changes first.

Upvotes: 30

Ewald Hofman
Ewald Hofman

Reputation: 12668

You can use the:

tfpt scorch

..command for this purpose. the TFPT command line is part of the TFS Power Tools

Upvotes: 19

PVitt
PVitt

Reputation: 11760

No, there is no command. As far as the version control doesn't know about the files that are not added to the version control, it cannot delete them.

Upvotes: -2

Related Questions