One-liner for deleting all unknown files from an SVN working copy

Have an SVN working copy that looks like this?

$ svn status
? projectname.tmproj
? svncommitconflict.tmp
? app/controllers/unneedefile_controller.rb
? app/views/notneeded
? tmp/sessions/ruby_sess.be20aac7aff763cf
? doc/all
X vendor/rails

$

Clean it up with this!!

$ svn status |grep ? | cut -c 8- | xargs rm -rf
$ svn status
X vendor/rails

Performing status on external item at ‘vendor/rails’
$

Be careful to not wipe out files you need. For example while figuring out this command I deleted my TextMate project file. Doh! I wish I had told SVN to ignore it, using svn propedit svn:ignores ..

1 Response to “One-liner for deleting all unknown files from an SVN working copy”


  1. 1 jeff

    svn propedit svn:ignores .. got it.

Leave a Reply




Close
Powered by ShareThis