I’d love to have a script/app that will recursively delete the .svn directories from a directory. I tried modifying the Delete .DS_Store files script for OnMyCommandCM but I didn’t have any success.
Anyone have a script or app they want to share? A droplet would be cool. 🙂
LazyWeb, do your thing.
Isn’t there an svn export that will checkout a module without all the .svn directories? Should be just like cvs export (or close to it).
Try this…
find . -type d -name ‘*.svn’ -print0 | xargs -0 rm -rdf
Beautiful – works great! I actually used ‘.svn’ instead of ‘*.svn’ since the directories are actually named ‘.svn’.
Thank you very much Rich.
find . -type d -name ".svn" -exec rm -rf \{\} \;
if you don’t want xargs.
you know, I think this is the first lazyweb I’ve seen answers for? 🙂
Although if you’re just making a tarball and don’t want to include the .svn, you can
tar xzf myproject.tgz myproject/ --exclude "*.svn"
I don’t know of an svn emerge that doesn’t do the svn directories.
Though you could probably hack some wget command together, since it’s all webdav.
As you noted, find is just the thing for this. I strongly recommend reading the documentation for this wonderful and immortal UNIX command, which has 1001 uses! When you learn it, to continue the Arabian metaphor, the filesystem will forever play a cooing and willing Barbara Eden to your Larry Hagman!
If you used svk (perl expansion on svn) you wouldn’t have any .svn directories. It centralizes everything you check out into _one_ repository on your computer. But you still have one dot-file in your home directory, so it’s not perfect.
It also has lots of neat features, like being able to do every operation offline. Leads to a lot of n-way merges though…
Check out the website here:
http://svk.elixus.org/
And here’s some slides that do a nice overview of its features:
http://wagner.elixus[...]o/svk-intro/
SVN Zapper
With some big time help from Adam Tow, I finally put together the AppleScript droplet I wanted for removing ‘.svn’ directories. Here it is (LGPL):
Download: SVN Zapper (3.2 KB)
afaik, svn export will give you a clean tree with no .svn directories.
I wrote a shell script to do this that will work on Mac. It is at:
http://www.forgeniuses.com/?p=8
[…] find . -type d -name "build" -exec rm -rf {} ; https://alexking.org/blog/2004/09/08/wanted-mac-os-x-script-to-delete-svn-folders […]
The subversion export function worked perfectly for me. Thanks Michael! That seems like the “correct” way to do things. I am using Versions 1.1.10 on Mac OS X. To export I did the following:
1. Select the directory from within an existing repository that I wanted to export
2. Go to File -> Export in menu
3. Select where I wanted the files to be exported
Thanks for the tips guys.