July 31st, 2006

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:


			Posted by jnunemaker in Externals
			
		

Thoughts? Do Tell...


(textile enabled)

About

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

Syndication

Feed IconRailsTips Articles - An assortment of howto's and thoughts on Ruby and Rails.

Feed IconRails Quick Tips - Ruby and Rails related links that I find. Never more than 5 a day.

Search