7

How do I recursively delete all .svn directories, starting with the directory I am in?

djsmiley2kStaysInside
  • 6,943
  • 2
  • 36
  • 48

3 Answers3

12

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
9

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

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

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