Caveman's Blog

My commitment to learning.

Recursively delete SVN folder

leave a comment »


Today is the first day for me on another project at work. I could not get the latest code  from Subversion [2] because I did not have sufficient privileges. I had borrowed the source code from a colleague so that I can get up to speed with the existing framework, while the permissions are resolved. In the solution that I copied all the sub folders had a “.svn ” folder and I just did not like that.

I thought of writing a .Net console app to recursively delete all the “.svn” folders of the solution and as always googled first, to see if there was a easy alternative — why reinvent ;). Indeed there is a command line solution by “Eber Irigoyen” [1], that does a fantastic job. Here is how I used the command;

1. Open a command window.
2. Navigate to the root folder from where you would want to start deleting the “.svn” sub-folder recursively.
3. Execute the following command


for /f "usebackq" %d in (`"dir *.svn /ad/b/s"`) do rd /s/q "%d"

Replace the “.svn”  from the command with another folder name to delete it recursively.

Note: This does not work when the folder name has a blank(s) .

Reference:
1. Recursively delete svn folders easy way
2. Subversion

Advertisements

Written by cavemansblog

July 1, 2009 at 11:34 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: