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
Shouldn’t it just be ‘.svn’ without the *?
if you are living in UNIX land this works:
rm -rf `find . -type d -name .svn`
@Justin – Since the svn folders are all named “.svn” I think we’d have the same net result if the * is included or not. To ensure we only delete the “.svn” directories and no other variation like “donotremovethis.svn” we’re probably better off using your approach.
@David – Thanks for the contribution. The UNIX command is a nice addition to the post.
I?¦ve been exploring for a little for any high-quality articles or weblog posts on this kind of area . Exploring in Yahoo I eventually stumbled upon this site. Studying this info So i?¦m glad to show that I’ve an incredibly just right uncanny feeling I discovered just what I needed. I most no doubt will make certain to do not fail to remember this website and provides it a glance regularly.
I gotta favorite this site it seems extremely helpful very helpful