July 31, 2006

Posted by John

Tagged rake and subversion

Older: Back from Vacation and New Links Feed

Newer: Simpler IRB

Handy Subversion Rake Task

James Hill recently posted this handy rake task to add all files with an svn status flag of ‘?’ to your working copy.

namespace :svn do
  desc "Adds all files with an svn status flag of '?'"
  task(:add_new) { `svn status | awk '/\\?/ {print $2}' | xargs svn add` }

You can then call rake svn:add_new to add all your new svn files. I have an alias in my .bash_profile that I use named svnaddall that does the same thing and looks like this:

alias svnaddall='svn status | grep "^\?" | awk "{print \$2}" | xargs svn add'

I also have this alias to clear the subversion in the event that I need to:



Sorry, comments are closed for this article to ease the burden of pruning spam.


Authored by John Nunemaker (Noo-neh-maker), a programmer who has fallen deeply in love with Ruby. Learn More.


Release your software more often with fewer problems.
Flip your features.