Removing all those .svn files
Posted February 20, 2008on:
Im working on a project now and using subversion a lot for the project. One of the things that has been annoying me in the last while is sometimes I want to move code into another svn repository while working on it, and really the only way to do it is to remove all the .svn directories check out the top level empty directory of the repository I want to place the code into and then do svn add *
The only problem been that removing all the .svn files can be a real pain on large projects.
find . -type d -name ‘.svn’ -print0 | xargs –0 rm -rdf
Is a very handy command that I now use all the time. What this does is find all the .svn directories and removes everything below them, leaving me free to add the code back into another subversion repository.
Update: This is also very handy way of reducing the transfer size if using SCP to move your code between servers. As when working on SVN subversions files the .SVN directories can double the size of your code on disk as they store copies of the files in the .svn folders for later comparison