OS X Finder Plugin to Remove .SVN Directories

Tools

OS X Finder Plugin to Remove .SVN Directories

We use SVN to store all of our source code here at Sitening. And, like most people who use it, you often find yourself in need of cleaning out all the .svn directories that it creates. There’s no easy way to do this without turning to the command line – and that’s not an option for non-programmers.

To fix this problem, I whipped up a small Finder plugin using Automator that adds a new menu when you right-click on a folder. With one click you can remove all the .svn directories inside it. Download the plugin here.

To install, simply unzip the file and drag it into your Library/Workflows/Applications/Finder directory. If that folder doesn’t exist, you’ll need to create it. I hope this helps all the non-techie SVN users out there.

P.S. – For the geeks in the audience, the command I’m using to remove the .svn folders is

find . -name .svn -print0 | xargs -0 rm -rf

Related Posts Plugin for WordPress, Blogger...

Tell us what you think

  • http://olchowka.info/ Denver

    Your plugin saved lots of my priceless time. Thank you very, very much!

  • http://clickontyler.com Tyler

    Yikes, sorry about that Andre.

    Adding a -x argument to the find command will prevent find from spanning across physical volumes.

  • AndreL

    PAY ATTENTION. I was cheking out the plug-in installation and I clicked the “Remove…” command from my desktop. As a consequence, it has erased all the .svn in ALL the network volumes I had mounted. We have lost hundreds of working copies that now need to be recreated. A note on this would have been appreciated…

    The plugin works like a bomb, very powerful, but very, very dangerous…

  • http://michael.tyson.id.au Michael Tyson

    Re: Colin – You can avoid the -print0 and -0 flags, but then I’m pretty sure it’ll have trouble with paths including spaces; if one happens to have directory names with spaces, it’ll fail with those directories.

    A better alternative is using find itself to perform the command (note the slash-semicolon):

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

  • http://www.sitening.com/ Tyler Hall

    Yep, but this is good for less technical users. Dropping into a terminal window isn’t always an option for everyone. But, you’re right. Exporting would work, too.

  • Evan Wired

    You know that you can always do an svn export and get a clean copy of whatever is in your repository without the subversion metadata, right?

  • http://www.sitening.com/ Tyler Hall

    Aha. That’s easier.

  • http://oakwinter.com/ Collin

    You don’t need the -print0 or -0 flags; “find . -name .svn | xargs rm -fr” will do the same thing.