Skip to content

Instantly share code, notes, and snippets.

@newportandy
Created March 17, 2010 23:37
Show Gist options
  • Save newportandy/335865 to your computer and use it in GitHub Desktop.
Save newportandy/335865 to your computer and use it in GitHub Desktop.

SVN Cleaner

Git creates one .git folder in the root of a project. SVN creates a .svn/_svn folder in every single folder of it's project. This script cleans out the ( _svn | .svn ) folders left behind by subversion, it's useful when you don't already have an automated release process in place to do this and you quickly need to clean pu a checked out repo for a client/release.

Use this at your own risk.

require 'fileutils'
Dir.chdir('Directory that you want to clear svn junk folders out of.')
Dir.glob('**/{.,_}svn').each do |svn_dir|
FileUtils.rm_rf(File.join(Dir.pwd, svn_dir))
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment