Subversion Tip

Grabbed this little tip from the web. If you’ve ever had to add multiple files to a subversion repository from the command line then you understand the pain involved. This pain can be reduced by running: svn status | grep \? | cut -f7 -d’ ‘ | xargs svn add

This series of commands will run run svn status, the output from that is then run through grep \? which finds all lines containing a question mark. The output from grep is passed to cut -f7 -d’ ‘ which selects the path name, and these multiple lines are then passed on to xargs svn add which combines all of the unknown paths into a single call to svn add.