When you have to remove all .svn directories from a project with many sub-directories, you could do it manually, but why not use our nice friend called command-line?
On Unix-based OS’s you can find many examples of many ways to do this, but on Windows I could not find one (very easily). So I tried to create one myself with some “for … in … do” magic. And here it is:
for /d /r "c:\path\to\project" %a in (*.svn) do rd %a /s /q
Hmm.. It seems’s like if the .svn directories keep the “hidden” attribute, the code above doesn’t work. Instead you’ll have to do it in two steps:
print all .svn dirs to a file (execute this command in the directory where you want to delete the .svn directories):
dir *.svn /b /A:HD /S > svn-files.txt
after that one, execute this command:
for /F "eol=;" %i IN (svn-dirs.txt) DO rmdir %i /q /s
and it will work just fine (for me at least..)
Off course, whenever it is possible, it’s way better to make an export from the repository, but that is not always possible…
Had to use this today when I wanted to copy a batch of folders (200+) from one svn project in eclipse to another. Still an awesome tip :)
Thanks!!
Glad to hear!
Thank you so much!