Removing Multiple .svn Directories

At one time, I had a tarred site still containing all its .svn directories. Needing to just start over and remove all .svn directories, I found the answer at Linux by Examples under the aptly named page “Remove All .svn Directories at Once“.

However, if for any reason this page ceases to exist one day, I’m posting it here for posterity (or until I shut this site down):

If you want to remove them all at once, here’s one way to do it:
~/project_dir $> find -name .svn -print0 | xargs -0 rm -rf

A more efficient way listed here:

find /project_dir -type d -name .svn -exec rm -rf ‘{}’ +

Of course there is a mention that the best course of action is to use svn export, but in some cases, this can’t allways be done:

svn export project_dir new_dir

So that’s the way to remove all those pesky .svn directories if you’re ever handed a site copy littered with them.

Post written by Ed Reckers

Founder and lead web development consultant at Red Bridge Internet : San Francisco WordPress Developers and Consultants.

Leave a Reply