How to Recursively Remove .svn Directories?

Solution 1:

Keep in mind that svn provides the "export" command that provides you with a copy of your working tree, but without all the .svn directories sprinkled in. This could be what you want.

$ svn export /tmp/copy_of_my_tree

Solution 2:

If you're working in Linux (or equivalent), you can just do the following:

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

Solution 3:

In any modern UN*X-like system (Linux, Mac OS X, FreeBSD):

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

find:

  • in the current directory
  • directories
  • with name .svn
  • and when found, run rm -rf on each