Skip to content

Instantly share code, notes, and snippets.

@djcsdy
Created March 17, 2011 16:03
Show Gist options
  • Save djcsdy/874592 to your computer and use it in GitHub Desktop.
Save djcsdy/874592 to your computer and use it in GitHub Desktop.
Powershell script to delete files from an SVN working copy that are neither version-controlled nor ignored. Roughly equivalent to git clean -f. Requires the command-line svn to be located in your %PATH%.
svn status |
Select-String '^\?' |
ForEach-Object {
[Regex]::Match($_.Line, '^[^\s]*\s+(.*)$').Groups[1].Value
} |
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment