Showing posts with label SVN. Show all posts
Showing posts with label SVN. Show all posts

Tuesday, July 1, 2008

Clear all .svn files from a subversion working copy (UPDATE)

To detach a checked-out subversion working copy and therefore clean all subversion related files (e.g. those nested .svn directories) you can type:

rm -rf `find . -type d -name .svn`

You can also make yourself a little bash script (called e.g. svnclear):

#!/bin/sh
echo "recursively removing .svn folders from"
pwd

rm -rf `find . -type d -name .svn`

via AnyExample

Update 04.05.2009:

As Isimonis pointed out in the comments, it is better to use a different approach if you have many files:

find $DIR -type d -name ".svn" -print0|xargs -0 rm -rf

Or you can use the new options of newer "find" versions:

find $DIR -type d -name ".svn" -delete