Text* Snippets: Recursively remove all .svn directories [shell] [svn] [bash]

I am always looking for this command.

Usually, you if you need a code base without the .svn directories, you can just do an svn export. This is especially good for deploying to web applications from known revisions/releases inside of version control.

Sometimes however, there arises the situation where a collection of files that were once in version control, and were orphaned for whatever reason, and that code needs to get re-added to version control, the .svn directories present in the directories will conflict with a new svn add command. In that case use this command:

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


One Response to “Text* Snippets: Recursively remove all .svn directories [shell] [svn] [bash]”  

  1. 1 Gabriel

    You should also be able to use this variation:

    find . -name .svn -exec rm {} /;

Leave a Reply



A Few Books on My Shelf

Flickr

www.flickr.com
This is a Flickr badge showing public photos and videos from Ben Wann. Make your own badge here.