Deleting .svn files on OSX

Go to the terminal, navigate to the folder you want to delete files from and type :


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

This should delete all .svn folders in the current directory and recurse down into sub-folders too. Please be careful with this! :-)

I also found this handy AppleScript which will toggle hidden files on the mac:
ToggleHiddenFiles

Thanks to Niqui Merret and Raymond De Vries for helping with this.

Bookmark and Share

Related posts:

  1. FOTB Flash 3D source files
  2. Papervision3D training working files
  3. FlashBelt Particle presentation – source files
  4. Flash Games Training working files

13 Responses to “Deleting .svn files on OSX”

  1. Mikael Gueck says:

    Why “*.svn”, when the directory is always named just ‘.svn’?

    You might want to look at the xargs program as well.

  2. I dunno. :-) You have a good point :-)

  3. Mikael Gueck says:

    Sometimes when your project is large enough, it’s possible to use find | xargs in a way which overflows the maximum length of a single command line command. For these situations, xargs has a -n argument, which you can use, for example, to call a script which only accepts a single file name as an argument, by using the xargs argument -n 1. If your call to rm is overflowing, a reasonable argument would be -n 25.

  4. ah that definitely would be the problem – thanks Mikael! So would an xargs version be :

    find ./ -name “.svn” -print0 | xargs -0 rm -Rf -n 100

    ?

  5. John says:

    Or use SVNUtil http://svnutil.riaforge.org/ written by my buddy Omar Gonzalez, which is an AIR app for doing the same thing.

  6. Matthew Hare says:

    With SVN, you can export a directory, or your entire project to another folder. This essentially gives you a copy of your project, without any SVN data attached/hidden.

  7. felix says:

    You might want to try Path Finder – a souped up Finder that has a ‘show hidden files’ toggle amongst other thing (tabs!). http://www.cocoatech.com/

  8. Mikael Gueck says:

    The xargs command line would be

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

    Also, the GNU find command also accepts the parameter “-type d” which only selects directories.

  9. Ed Salvana says:

    I use this mighty handy tool called SVN Zapper: http://alexking.org/projects/svn-zapper. Drag and drop a folder onto it and it gets rid of all .svn files! :)

  10. jacob says:

    a friend of mine wrote this air app that will remove all svn files as well. http://dinopetrone.com/tidysvn/

Leave a Reply

Bad Behavior has blocked 1363 access attempts in the last 7 days.