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?
svn status | grep "^\?" | awk '{print $2}' | xargs svn add
Comments
Subscribe to comments
You need to login to post a comment.

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
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
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
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