Remove all .svn folders in a directory tree

Posted by Ingmar Hendriks on 26 June 2009

I have a MacBook and I use the Subversion (scplugin) plugin which integrates with Finder. I use subversion for projects on school together with my project members. When i finished one of my projects, I wanted the code to be included on a CD. However i didn't want the .svn directory’s to be included on it.

A friend of mine approached me and said he knew the perfect solution, use the Terminal and go to the directory you want detach from the subversion server and run the command below. This removes all the .svn directory’s which the plugin created in every subdirectory in the root you have attached to a SVN server.

find . -name ".svn" -type d -exec rm -rf {} \;

The .svn directory’s are now deleted.

Source: http://www.molnetwork.nl/