I have a directory with many sub-directories. In each folder there is a subversion folder (.svn).
Is there a command in windows that will go through each folder and sub-directory and delete the .svn folder?
Or will I have to create a script or do it manually?
Use the
svn export
command to export a Subversion working copy into a new "clean" directory structure that doesn't have the.svn
directories.Do this in PowerShell.
NOTE: This is recursive so be sure you are in the right directory!
Here is the rest of my source tree cleanup script.
Just type .svn in the search box of the File Explorer, then select and delete all search results (see JB Nizet's comment). This method can of course also be used to quickly delete the obj and bin directories, e.g. when organizing svn archives.
Although OP asked for a commandline solution, he also indicated using Windows, and considered a manual deletion, so the File Explorer method could still be considered, especially because it is the fastest method and does not rely on 'tools' like svn export.
Although OP already selected an accepted answer, this answer might still be useful for others. At least it was useful for me, a long time linux / windows user who prefers command lines and first learned about the search box by this post :-)
I know its too late to answer this but i guess there is an easy way IF have eclipse and the svn plugin installed on your eclipse. Right click on the project, go to Team->disconnect. It will open a popup where you select the first option: 'Also delete the SVN meta-information from file system.' This will remove all the SVN folders automatically along with svn property files that you might forget sometimes while removing .svn folders only!
If you want to delete all sub folders named .svn in windows then create batch file with this content:
save it in a file del_All_Dot_SVN_Folders.cmd . Run it. You're done.
Thanks to http://www.axelscript.com/2008/03/11/delete-all-svn-files-in-windows/
Remember the above code has .svn whereas the code in the link has only *svn so its better to have the .svn to not accidentally have undesired effect.
Make a litte batch file with the following line and execute it from the parent folder under which there are .svn directories.
You can also issue the line below straight from the Command Prompt: