Clearing Subversion information from a project

Subversion stores its information in hidden folders named “.svn” inside each added directory. Sometimes, you might want to remove all off these .svn directories, and start fresh. There are any number of reasons to want to do this, but in my case I wanted a quick way to reset a working copy on a windows machine.

I found a good batch script (source) that does exactly what I needed:

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

I just threw that line in a text file, and saved it as rmsvn.bat in the highest directory that I wanted to strip .svn files from.

Opening up a command prompt, changing to the directory I saved the batch file in (with cd) and then running the file (with rmsvn.bat) worked perfectly.

Posted Sunday, January 31st, 2010 under tips and tricks, windows.

Leave a Reply