Remove subversion stuff from the sources

You may need to remove subversion stuff from some sources to add them onto another repository. Following bash command can do it assuming you’re in the root directory of the sources:
for FILE in `find | grep ".svn"`; do if [ -d $FILE ]; then echo "file: $FILE"; rm -rf $FILE; fi; done

4 responses to “Remove subversion stuff from the sources”

  1. You should do ‘svn export’ instead of ‘svn checkout’ if you want to get source code from repository without SVN meta information. ‘svn export’ is often used for code distributions and deployments.

  2. Alternatively, you can simplify the command as “find | grep .svn | xargs rm -rf”

  3. Sergey says:

    Or… find -type d -name ‘.svn’ | xargs rm -rf

  4. Thanks, guys! I like Linux because one task can be done by different ways 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *