locked
Clean up workspace

    Question

  • Is there any way to remove from workspace files that are not in source control?

    This is my scenarios:

    1. I unshelve other developer's shelveset to perform code review, and this shelveset contains new files. If I undo changes on the solution, the new files are still on my local disk. When developer submits his changes to source control and I'm getting them, I'm facing conflicts.
    2. If delete a folder or project in VS, sometimes it removes it from source control, but cannot delete physical folder because it's being used by some program (explorer). Next time I try to create the folder I'm going to get an error that it already exists.

    What I need is a way to reset my local folder mapped to some workspace, so would contain only files and folders from source control and nothing else.

    I'm currently achieving it by closing solution, deleting all files, and getting "specific version" with "overwrite all files".

    Is there any easier way to do the same?


    Regards, Dmitry
    Wednesday, July 27, 2011 1:16 AM

Answers

  • Have you looked at the tfs powertool, it has a commandline util with, amongst other 2 commands that could be helpfull for you.

     

    tfpt scorch - Ensure source control and the local disk are identical

    Use the scorch command to ensure that source control and local disk are identical. Your local disk will be scanned for items which are not in source control. These items will be deleted from disk, just as in tfpt treeclean. Additionally, items determined to be different on disk from those in source control will be redownloaded from the server. Items with pending changes are exempted.

     

    tfpt treeclean - Delete files and folders not under version control

    Use the treeclean command to view and optionally delete files that are not under source control in the current directory and all subdirectories. This command is useful when you want to remove temporary files from your local workspace, such as files created by the compiler.

    You can download the tfs powertools from http://msdn.microsoft.com/en-us/vstudio/bb980963

    Sunday, July 31, 2011 10:33 AM

All replies

  • Have you looked at the tfs powertool, it has a commandline util with, amongst other 2 commands that could be helpfull for you.

     

    tfpt scorch - Ensure source control and the local disk are identical

    Use the scorch command to ensure that source control and local disk are identical. Your local disk will be scanned for items which are not in source control. These items will be deleted from disk, just as in tfpt treeclean. Additionally, items determined to be different on disk from those in source control will be redownloaded from the server. Items with pending changes are exempted.

     

    tfpt treeclean - Delete files and folders not under version control

    Use the treeclean command to view and optionally delete files that are not under source control in the current directory and all subdirectories. This command is useful when you want to remove temporary files from your local workspace, such as files created by the compiler.

    You can download the tfs powertools from http://msdn.microsoft.com/en-us/vstudio/bb980963

    Sunday, July 31, 2011 10:33 AM
  • Mattias +1, for the great reply!
    Please remember to mark the replies as answers if they help.

    Tarun Arora

    Blog: http://geekswithblogs.net/TarunArora  Subscribe in a reader

    Monday, August 1, 2011 11:14 AM
  • Thank you, this is helpful. Hope to see this fincutionality in GUI some day.


    Regards, Dmitry
    Monday, August 1, 2011 11:58 AM