Add multiple files in subversion at once.
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.
Tags: subversion, sysadmin





May 22nd, 2006 at 9:43 pm
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.
July 10th, 2006 at 5:21 am
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.