Command to recursively remove all .svn directories on Windows Command to recursively remove all .svn directories on Windows windows windows

Command to recursively remove all .svn directories on Windows


Make a litte batch file with the following line and execute it from the parent folder under which there are .svn directories.

FOR /F "tokens=*" %%G IN ('DIR /B /AD /S *.svn*') DO RMDIR /S /Q "%%G"

You can also issue the line below straight from the Command Prompt:

FOR /F "tokens=*" %G IN ('DIR /B /AD /S *.svn*') DO RMDIR /S /Q "%G"


Do this in PowerShell.

NOTE: This is recursive so be sure you are in the right directory!

gci -fil '.svn' -r -force | ri -r -force

Here is the rest of my source tree cleanup script.

gci -fil 'bin' -r -force | ri -r -forcegci -fil 'obj' -r -force | ri -r -forcegci -fil '_ReSharper*' -r -force | ri -r -forcegci -fil '*.suo' -r -force | ri -r -forcegci -fil '*.user' -r -force | ri -r -force


Use the svn export command to export a Subversion working copy into a new "clean" directory structure that doesn't have the .svn directories.