Click here to Skip to main content
15,882,055 members
Articles / SVN

Recursively Remove .svn Folders

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
10 Jun 2012CPOL1 min read 14.3K   1   4
How to recursively remove .svn folders

You're a Developer, You Need A Source Control System

So far in my experience, I've used a few floppys, dvd-rw's, thumb drives, external hard drives, emailing myself zipped up folders, Cloud Storage (Microsoft's SkyDrive), to Microsoft's Visual Source Safe, SVN and Microsoft's Team Foundation Server.

As of the last few years, I've been using SVN and I'm pretty happy with it! The local comparison's offer good speed instead of doing a client-server compare everytime I need to check and it's very simple to manage multiple checkouts and merge (if you ask me); but there's one catch to all that... it creates a local copy of every file in a hidden .svn folder parent to the directory. When it comes time to copying a folder, you're doing twice the work and twice the storage.

I know I'm not alone with this endeavor. Many colleagues and friends express the same challenge when they want to just share the actual code and not the duplicated folders created.

So, That Being Said

If you've ever wanted to remove all those hidden .svn folders that are created by SVN, here is a simple bat script to do that work for you. Just save it as RemoveSVN.bat and let this take care of the rest.

@echo off
echo Please enter a full directory to remove SVN hidden directories from:
set /p SVNDir=
cd %SVNDir%
dir treelist
for /f "delims=" %%x in ('dir /b /ad /S .svn*') do rd /s /q "%%x"

This article was originally posted at


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

QuestionNot needed Pin
Mehdi Gholam10-Jun-12 10:47
Mehdi Gholam10-Jun-12 10:47 
AnswerRe: Not needed Pin
BigTimber@home11-Jun-12 4:36
professionalBigTimber@home11-Jun-12 4:36 
One exception -- this is true unless you use svn-externals; if you do use externals, it will still populate your tree with .svn folders locally in any of your external'd elements.
SuggestionTortoise SVN: Export Pin
N-O-R-B-E-R-T10-Jun-12 10:35
N-O-R-B-E-R-T10-Jun-12 10:35 
GeneralRe: Tortoise SVN: Export Pin
SteveKing10-Jun-12 22:29
SteveKing10-Jun-12 22:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.