Home > Linux > Remove subversion stuff from the sources

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:

  1. for FILE in `find | grep ".svn"`; do if [ -d $FILE ]; then echo "file: $FILE"; rm -rf $FILE; fi; done

Categories: Linux Tags: ,
  1. July 23rd, 2009 at 13:01 | #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. July 23rd, 2009 at 13:02 | #2

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

  3. Sergey
    July 31st, 2009 at 10:12 | #3

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

  4. July 31st, 2009 at 11:23 | #4

    Thanks, guys! I like Linux because one task can be done by different ways :)

  1. No trackbacks yet.

Get Adobe Flash playerPlugin by wpburn.com wordpress themes