Skip to content

Instantly share code, notes, and snippets.

@djcsdy
Created April 20, 2011 15:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djcsdy/931645 to your computer and use it in GitHub Desktop.
Save djcsdy/931645 to your computer and use it in GitHub Desktop.
Powershell script to delete all unversioned files from an SVN working copy, including ignored files. Roughly equivalent to git clean -f -x. Requires the command-line svn to be located in your %PATH%.
svn status --no-ignore |
Select-String '^[?I]' |
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