Paul Kiddie

Recursively remove .svn folders from checked out projects in Subversion

December 03, 2009

Thought I would post this as I find I need it regularly. This is thanks to a great blog post over at http://perezj.blogspot.com/2008/10/delete-svn-folders-files-recursive.html which details how to write a batch file which recursively removes .svn folders from a checked out folder from Subversion. It boils down to the following:

1. Create a batch file in checked out folder

2. Edit the batch file, then copy and paste the following text:

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

3. Open a command prompt, navigate to the folder you checked out and type in the name of the batch file. Watch as it iterates through and removes all .svn folders :)


👋 I'm Paul Kiddie, a software engineer working in London. I'm currently working as a Principal Engineer at trainline.