How To Clean SVN Checkout Directory

I just love

git clean -xfd

but you just don’t get that with Subversion. Instead from your Bash shell (or Cygwin) prompt you can do:

svn status --no-ignore | egrep '^[?I]' | cut -c9- | sudo xargs -d \\n rm -r

I got that last one from http://stackoverflow.com/questions/239340/automatically-remove-subversion-unversioned-files

Oh, and on that same post, for PowerShell users I found

function svnclean{
svn status | foreach { if($_.StartsWith("?")) {Remove-Item $_.substring(8) -Verbose}
}

I could resist saving these two snippets, I know I will need them.

Download PDF
This entry was posted in Bash, PowerShell. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *