Recursively Removing Subversion Files
Thu, 12/20/2007 - 18:34.
Tags:
More often than we'd like to acknowledge we get a need to remove Subversion .svn files in the working copy.
This will do it:
find . -name .svn -print0 | xargs -0 rm -rf 
svn export
Alternatively, you could simply do an SVN export. That's the same as a checkout, but without the .svn stuff.
True
Very true, if you are getting a fresh copy from a repository. The solutions described above, though, is for the cases when you already have garbage in the work copy and need to clean it up.
E.g. if you are merging two projects, getting one module from project A, another module from the other project and they come from different repositories, you may want to wipe-out the whole subversion thing and put everything in a new repo, altogether. Otherwise, Subversion may go nuts..
Another alternative
If your goal is at all moving the files around (or copying), you can use rsync with the -C (that's an upper case C) option which tells rsync to avoid CVS-like files. Rsync's definition includes ".svn/".
Full syntax example:
rsync -aCvz --delete old-location new-locationAwesome
Thanks, Doug.
Did not know rsync could do such stuff, as well. Loving it even more, now :)