July 31, 2006
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` }
end
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:
Tags: rake and subversion



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