Skip to navigation

Removing .svn directories in Terminal

If you’ve ever faced that truly … testing … task of needing to remove a whole heap of hidden .svn directories from a folder and it’s myriad subfolders because some idiot did an SVN Checkout rather than Export to a development server, you’ll love this Terminal command:

find . -name .svn -print0 | xargs -0 rm -rf

You can run it from inside any folder to remove all .svn folders from it and all it’s child folders. Beautiful.

— Kudos to Red 91

discount ultram
cheapest generic cipro
generic viagra cheap
cialis online find
pharmacy cialis online
medicine lasix
viagra prescriptions
sale propecia
ultram cheap generic
kamagra alternative
kamagra sample
cialis herbal
buy soma generic
ultram certified
buy now lasix
tabs zithromax
buy acomplia generic
tabs soma
kamagra compare
acomplia compare
buy online acomplia

So far 2 people have argued with us about ‘Removing .svn directories in Terminal’. Read what they've said and then add to our woes using the form below.

Overvince · Tuesday 15th April at 20:24

Great, thank you very much!
This one should work too:
find . -name .svn | xargs rm -d -r

Dave · Friday 24th October at 07:27

Thanks for this command, saves me a *lot* of time running the ‘rm -rf ./*/.svn’ command, manually adding ‘*/’s until I *think* I got them all.. Shows how much I know about terminal! :)

One question though; in your post you write about how some ‘idiot’ did a checkout instead of an export to a development server. Can you elaborate on that? I recently started (actively, before I did it once-in-a-while) using svn to publish my websites. I use an .htaccess file to block out any possible user access to the .svn folders, but I do use the checkout method. I like the idea of being able to apply changes to the live site whenever I need to (ie. I’m not on my own machine, and need to run a small fix on the live site). I can then easily commit those changes, and fetch them back to my work machine(s) when I’m back.

Maybe I’m thinking completely wrong though, and it’s a major mistake to use this method. So, not trying to tell you you’re thinking wrong, just trying to figure out which way is ‘best’. Drop me a line via email if you want to discuss some more.

Thanks!

-Dave

Love what we’ve said? Think we’re talking nonsense? Don’t worry about being polite, just let us have it. We’re not afraid of telling you that you’re talking crap, so don’t be afraid of telling us the same.