I often need to delete not-versioned files in SVN. Although I am supposed to create projects that place all output outside of the SVN client structure, it’s not always practical. So all those pesky generated files are hard to get rid of and pollute my svn status. I frequently dump the output of
svn status | findstr "^?_" into a .cmd file and edit it replacing all ? with
We can do better. I added a new tool, svn2 to the Svn2Svn project. Svn2 has a sync command that sends all non-versioned files to the recycle bin. Use at your own risk – this will delete files that haven’t been svn-added.
Svn2 uses SharpSVN which can run a status command. For each file that is not-versioned, we call a Microsoft.VisualBasic.FileIO function to recycle it.