Add all new files to svn repository


/ Published in: SVN
Save to your folder(s)



Copy this code and paste it in your HTML
  1. Whippy posts on May 15, 2009 at 07:04
  2. To get the 'A' status, the file must already be added. You need to match a '?'. Here is what I use:
  3.  
  4. svn status | grep -v "^.[ \t]*\..*" | grep "^?" | awk '{print $2}' | xargs svn add
  5. svn commit
  6.  
  7. The first grep gets rid of any hidden files (which may be present if you use IDEs such as Zend studio).
  8. The second grep makes sure you only get files that are currently of unknown status (ie the new ones).
  9. awk grabs the file names.
  10. xargs passes the file names as parameters to svn add.

URL: http://codesnippets.joyent.com/posts/show/45

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.