Posted By

tylerhall on 04/08/08


Tagged

svn Bash recursive add


Versions (?)

Who likes this?

6 people have marked this snippet as a favorite

noah
moonbather
mybluevan
Wilco
caphun
Xantas


SVN Add Recursively


 / Published in: Bash
 

This adds all new files to SVN recursively. It doesn't work for files that have spaces in their name, but why would you create a file with a space in its name in the first place?

  1. svn status | grep "^\?" | awk '{print $2}' | xargs svn add

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: Tenzer on April 9, 2008

I think this should work with files which contains whitespaces as well, at least from my testing: svn status | sed -n '/^\?/ s/\? //; s/ /\ /p' | xargs svn add

Posted By: Tenzer on April 9, 2008

I just noticed that the extra whitespaces was removed from my post. This corrects it, and is probably also better: svn status | sed -n '/^\?/ s/\?\s+//; s/ /\ /p' | xargs svn add

Posted By: fenice on April 10, 2008

This latest command doesn't work for me, it doesn't remove lines with ! at the beginning. Here is my solution to add new files to svn (also files with whitespaces) :

svn status | grep '^\?' | sed -e 's/^? (.)/\1/;s/ /\ /g' | xargs svn add

Posted By: fenice on April 10, 2008

This latest command doesn't work for me, it doesn't remove lines with ! at the beginning. Here is my solution to add new files to svn (also files with whitespaces) :

svn status | grep '^\?' | sed -e 's/^? (.)/\1/;s/ /\ /g' | xargs svn add

Posted By: Pulsar on December 12, 2008

all it much simplier :) http://svnbook.red-bean.com/en/1.1/re01.html

$ svn add * --force A foo.c A somedir/bar.c A otherdir/docs/baz.doc [...]

Posted By: Pulsar on December 12, 2008

sorry for misposting

$ svn add * --force

A foo.c

A somedir/bar.c

A otherdir/docs/baz.doc

[...]

Posted By: fashiongilr on July 5, 2010

It’s so many designs of coach sandals on the web. But is it everything match your style? Maybe our consultants can offer you some tips on your coach factory outlet. Hey!Just be yourself. You will be surprised at our price and service because we are the coach factory store. Enjoy your shopping time and have a good day.

Posted By: rayallen on July 5, 2010

Our coach outlet online and coach outlet store is a professional offer coach brand like coach purse, coach outlets and the price is reasonable because we have our coach factory and here you also find the coach outlet store online. I am sure it will save you a lot of time and money if you buying from us.

Posted By: rayallen on July 5, 2010

MBT shoe is anti-shoe, Factory Direct, Top Quality. 60% OFF,$85 ONLY.MBT would like to help people around the world live more active, healthier and happier lives. [URL=http://www.prombtshoes.com/mbt-men-shoes-c-1.html]shoes mbt[/URL] attempt to awaken and strengthen the awareness of physiologically correct walking by publicizing the idea and concept of [URL=http://www.prombtshoes.com/mbt-men-shoes-c-1.html]Mbts[/URL] physiological footwear. They will not only change the way you use your muscles, but also will improve the use of your joints and spine. [URL=http://www.prombtshoes.com/mbt-women-shoes-c-3.html]mbt women[/URL] shoes sale promotion has been launched.

Posted By: rayallen on July 5, 2010

MBT Fora

Posted By: clarklouis on September 7, 2010

coach outlet coach handbags chanel handbags cheap coach handbags cheap chanel handbags shox shoes

Posted By: ahmet0851 on March 16, 2011

I use : svn status | grep '?' | sed 's/[?]//' | sed 's/^[ ]//'

Posted By: ahmet0851 on March 16, 2011

svn status | grep '?' | sed 's/[?]//' | sed 's/^[ ]//'

Posted By: ahmet0851 on March 16, 2011

Textile bug (whitespace and star)

svn status | grep '?' | sed 's/[?SPACE]STAR//'

You need to login to post a comment.