Search code examples
visual-studiotfsteam-explorer

TFS in VS - how to remove all included files with no changes?


I know there's an option to remove all included files that have no changes, without having to manually check each, but I just can't find it, and I can't find the answer anywhere.

I am using VS 2022.

I think it's supposed to be somewhere in the Pending Changes tab in Team Explorer.

I tried looking at all the options there available but I can't see the functionality I'm looking for.


Solution

  • there's an option to remove all included files that have no changes, without having to manually check each, but I just can't find it,

    Based on your description, you should be looking for the option: Undo pending changes -> Not to ALL when using TFVC repo.

    Test it in VS2022 and the Option is valid.

    For example:

    Right click your solution and select Undo Pending Changes

    enter image description here

    Then you can click Not to ALL option.

    For example:

    enter image description here

    Refer to this blog: TFS undo checkout of unedited files

    You just need to "Undo pending changes" on checkout files. When undo to a first "actually edited" files, will pop up a asking window to ask you "if you want to discard the changes". Select "Not to all" and all unedited files will be undo the checkout, and leaving all the files you actually edited.

    Note: DOES NOT SELECT added or deleted files when using the option: Undo pending changes to remove all included files that have no changes as the changes will be undone.

    For example:

    enter image description here