Howto recursively add unversioned files into SVN repository


Because svn add command does not support recursive addition of unversioned files you can use this little script to do it.
Create new file in /usr/local/bin with name svnadd with following content

#!/bin/sh
svn status | perl -ne 's/^\?\s+(\S.+)$/\1/g;chomp;system("svn add \"$_\"");'

Save it. From now on you can execute svnadd command in your working directory.

Be Sociable, Share!

,

  1. #1 by How I Was Able to Lose Thirty PĆ³unds in Thirty Days at May 6th, 2009

    Hi, good post. I have been wondering about this issue,so thanks for writing. I will probably be coming back to your posts. Keep up the good work

  2. #2 by Leo at March 25th, 2010

    What about svn add –force *
    bye, Leo

    • #3 by Vlad at January 14th, 2011

      small correction
      It should be :
      svn add –force *

  3. #4 by Christophe Meyer at January 6th, 2011

    Leo,
    Your command works perfectly well.
    Thanks, CMEY.

  4. #5 by Vlad at January 14th, 2011

    ooo I guess it just displays the – - as -, … nm.

    Vlad

  5. #6 by esdee at May 7th, 2012

    thanks!
    works like a charm

(will not be published)

  1. No trackbacks yet.