Delete All .svn Files in windows

I found this entry and found it useful….

http://www.broobles.com/blog/posts/36

Everything below is a direct copy and paste of the link above… but I don’t want to take the risk, should that link ever go down…

In Windows Explorer:

Right click on the folder and click Search..

Enter .svn as the filename to search for.

Click “More advanced options” and select:

– Search hidden files and folders

– Search subfolders

Press search button and delete the folders you find appropriate.

Oh, and this description is at least valid for windows xp pro.

The easiest way is by creating a .cmd script file at the root directory and execute it. Here is the code for cleanSVN.cmd :

for /f “tokens=* delims=” %%i in (’dir /s /b /a:d *svn’) do (

rd /s /q “%%i”

)

You could also just do a search in windows by pressing Ctrl + F, and then selecting find hidden files, and search “.svn” and then highlight all of them and press the delete key.

7 comments on this post.
  1. Stillnet Studios » Blog Archive » Deleting all your .svn directories:

    […] The Windows tips came from Axel’s blog at http://www.axelscript.com/2008/03/11/delete-all-svn-files-in-windows/ […]

  2. Dr. Mike Wendell:

    Thanks for this. Was wondering how to do it.

  3. jack:

    Thanks very much, the .cmd shell script works on Windows Vista.

    For others using this script – if you copy and paste the snippet of code, you need to replace the quotes and double quotes. WordPress renders the quotes in a way that Windows cannot parse.

  4. jack:

    Oh btw — the script in its current form can be dangerous. It will delete all files ending in “svn”. I happen to have non-svn files that end in svn! To make it safer, just add a dot after the *

    for /f “tokens=* delims=” %%i in (’dir /s /b /a:d *.svn’) do (
    rd /s /q “%%i”
    )

  5. Stanislav Stankov » Blog Archive » svn cleanup -:

    […] topics: How to clean .svn folders from your project How To Recursively Delete .svn Folders Delete All .svn Files in windows This work, unless otherwise expressly stated, is licensed under a Creative Commons Attribution 2.5 […]

  6. Invertus blog » Transfer svn checked out project to the new server:

    […] Source: http://www.axelscript.com/2008/03/11/delete-all-svn-files-in-windows/ […]

  7. Graeme:

    Nice one!!! I went through so many different
    find . …. -exec rm -rf alternatives but didnt even think to just use the search window..

    DOH!!

    G

Leave a comment