Skip to content

Instantly share code, notes, and snippets.

@rasmuskl
Created December 12, 2011 15:08
Show Gist options
  • Select an option

  • Save rasmuskl/1467722 to your computer and use it in GitHub Desktop.

Select an option

Save rasmuskl/1467722 to your computer and use it in GitHub Desktop.
Batch: Clean svn non-versioned and ignored files
@echo off
echo Cleaning non-versioned and ignored files...
FOR /f "usebackq tokens=2*" %%f IN (`svn status --no-ignore ^| findstr /B [?I]`) DO IF [%%g] == [] (rd /q /s "%%f" 2>nul) ELSE (rd /q /s "%%f %%g" 2>nul)
FOR /f "usebackq tokens=2*" %%f IN (`svn status --no-ignore ^| findstr /B [?I]`) DO IF [%%g] == [] (del /q /f /s "%%f" 2>nul) ELSE (rd /q /f /s "%%f %%g" 2>nul)
echo Done.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment