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 [sorry, no longer available]
Thanks to Niqui Merret and Raymond De Vries for helping with this.
14 replies on “Deleting .svn files on OSX”
Why “*.svn”, when the directory is always named just ‘.svn’?
You might want to look at the xargs program as well.
Oh and there’s an xargs version here //niquimerret.com/?p=116 but it doesn’t always seem to work for me. But then I’m still a bit of a terminal noob.
I dunno. đ You have a good point đ
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.
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
?
Or use SVNUtil //svnutil.riaforge.org/ written by my buddy Omar Gonzalez, which is an AIR app for doing the same thing.
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.
yeah that’s true Matt, although I still often need to do this if I’ve moved files around etc.
You might want to try Path Finder – a souped up Finder that has a ‘show hidden files’ toggle amongst other thing (tabs!). //www.cocoatech.com/
Thanks for the tip felix, I’m trying it now đ
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.
I use this mighty handy tool called SVN Zapper: //alexking.org/projects/svn-zapper. Drag and drop a folder onto it and it gets rid of all .svn files! đ
a friend of mine wrote this air app that will remove all svn files as well. //dinopetrone.com/tidysvn/
[…] to Seb Lee Delisle for […]