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
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
Also what I use is a
find . -name “.svn” -type d -exec rm -fr {} ;
which is the same without the need of xargs
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
Your script did not work on folder names with spaces.
I never use names with spaces in them inside of projects, so I never tested it with them. Thanks for posting what worked for your situation.
find . -type d -name .svn -print0 | xargs -0 rm -rf
Pingback: Michael Owen