Recursively Delete .svn Folders

Sometimes you need to move folders around, and when they are under version control, this can cause problems. If you’re feeling lazy and don’t want to svn export, then run this from the folder you want to scrub:

find . -name .svn | xargs rm -rf

7 thoughts on “Recursively Delete .svn Folders

  1. Also what I use is a
    find . -name “.svn” -type d -exec rm -fr {} ;
    which is the same without the need of xargs :-)

  2. Yeah, but that way is very ineffecient. It runs the rm command once for each result of find. If you had 1000 matches, it would take a very long time for it to finish. With xargs the whole list is passed in, and rm is run once with multiple options. Both work, and have their place, but for removing .svn folders, blowing through them all quickly is better for me.

    More info, if you’re interested: http://www.sunmanagers.org/pipermail/summaries/2005-March/006255.html

  3. Pingback: Michael Owen

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>