Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

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
You can’t perform that action at this time.