Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

Add all new files to Subversion (See related posts)

This solution is shell-agnostic, unlike http://textsnippets.com/posts/show/450, and cleaner than to do a --force. I recommend adding it to a alias in your shell, i.e "sall".

svn st | grep "^?" | awk -F "      " '{print $2}' | xargs svn add


Can be modified to do a svn delete on files you accidentally rm -rf'ed:

svn st | grep "^!" | awk -F "      " '{print $2}' | xargs svn delete

Comments on this post

meryn posts on May 20, 2007 at 15:14
As mentioned by Ian Burrel at http://textsnippets.com/posts/show/104 , file paths containing spaces will give problems when fed to xargs.

My solution:
svn status | grep "^?" | awk -F "      " '{print $2}' | tr "\n" "\0" | xargs -0 svn add

Which adds:
| tr "\n" "\0"

This mimicks the -print0 behavior of the find command.

You need to create an account or log in to post comments to this site.


Related Posts