Recursively delete .svn folders on Windows
July 21st, 2005
Subversion offers a nice “export” command which will export a clean copy of your project. This is very useful for distributing source code without the .svn folders which are present in the working copy. However, there are times when you will find yourself in front of a deep hierarchy of code which was provided by someone who just zipped up their working copy with all the .svn folders included.
Removing these folders is easy on *nix systems, by doing something like this:
find . -type d -name ‘.svn’ -print0 | xargs -0 rm -rdf
However, this elegant solution is not possible on Windows. So, how do you do it? You could write a quick script (Python, Ruby, etc) or use Ant to perform the task, but if you’re using Total Commander you can do this very easily in a few quick steps:
- Invoke a search (Alt+F7) from the projects root directory
- Search for .svn
- When the results are displayed, click the “Feed to listbox” button (bottom right)
- In the list that appears select all the folders and delete (Shift-F8)
Tags: Subversion, Total Commander