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
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.
Alternatively, you can simplify the command as “find | grep .svn | xargs rm -rf”
Or… find -type d -name ‘.svn’ | xargs rm -rf
Thanks, guys! I like Linux because one task can be done by different ways 🙂