Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Command to recursively remove all .svn directories on Windows

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?

like image 523
user489041 Avatar asked Feb 03 '11 17:02

user489041


People also ask

How do I delete a .SVN folder recursively?

The find command returns a list of all the subfolders matching “. svn”, and this is then piped to the rm command to recursively delete the directory. Running rm using the full path will remove the confirmation prompt, and the “rf” arguments will recursively delete any folder contents.

Can I delete .SVN folder?

To remove a file from a Subversion repository, change to the directory with its working copy and run the following command: svn delete file… Similarly, to remove a directory and all files that are in it, type: svn delete directory…

How to remove SVN repository in windows?

Right click the any folder and choose TortoiseSVN -> Repo Browser. Then point to your local repository in the URL field. Once open you could be able to browse the repo, and with a right click, delete the folder.


1 Answers

Make a litte batch file with the following line and execute it from the parent folder under which there are .svn directories.

FOR /F "tokens=*" %%G IN ('DIR /B /AD /S *.svn*') DO RMDIR /S /Q "%%G" 

You can also issue the line below straight from the Command Prompt:

FOR /F "tokens=*" %G IN ('DIR /B /AD /S *.svn*') DO RMDIR /S /Q "%G" 
like image 74
Ajit Vaze Avatar answered Oct 11 '22 02:10

Ajit Vaze