Add multiple files in subversion at once.
May 22nd, 2006
This works if all of the files that `svn info` lists as ‘?’ are files you actually want to add:
svn st | grep "^?" | awk '{ print $2}' | while read f; do svn add $f; done
If you want to see what’s going on there, start by running svn st and add new sections of the pipeline one at a time to see what each is doing.





I’ve done similar (though with cut instead of awk) and this will usually work, but if it’s possible you’ll work with files with spaces in their names, surround the “$f” with double quotes. xargs should work too, though I haven’t tried it, and might be faster on a large add.
Nice tip.
Great tip. It really helped me as I needed to add over 50 files - and I’m to lazy to do it by hand. Thanks.