SVN Export or Recursively Remove .SVN Folders
- by Ben Griswold
I shared this script with a coworker yesterday. It doesn’t do much; it recursively deletes .svn folders from a source tree. It comes in handy if you want to share your codebase or you get in a terrible spot with SVN and you just want to start all over. Just blow away all svn artifacts and use your mulligan.
It’s true. You can nearly get the same result using the SVN export command which copies your source sans the .svn folders to an alternate location. The catch is an export only includes those files/folders which exist under version control. If you want a clean copy of your source – versioned or not – export just might not do.
The contents of the .cmd file include the following:
for /f "tokens=* delims=" %%i in (’dir /s /b /a:d *.svn’) do ( rd /s /q "%%i" )
Just download and drop the unzipped “SVN Cleanup.cmd” file into the root of the project, execute and away you go.
If you search around enough, I know you can find similar scripts and approaches elsewhere, but I’m still uploading my script for completeness and future reference.
Download SVN Cleanup