How to cleanup a folder of SVN entries in Linux

Today I installed at work a Subversion ( SVN ) server and started to do repositories for our projects. At one project I got an error while committing files and then the cleanup operation errored out :( . The quick fix for this is usually to delete all “.svn” folders from the current folder. But what do you do if you have a project with thousands of folders in it? Stay all day? :)
No! The solution is pretty simple , just go with the shell in the problematic folder and write this command line :

  1. find . -name ".svn" -type d -exec rm -rf {} \;

which will delete recursively all folders called “.svn” from the current folder

I hope you’ll find this useful :)

One Comment

  1. Sorin says:

    For Windows XP/Vista/other flavours you can create a .bat file , put this command in it :

    FOR /F “tokens=*” %%G IN (‘DIR /B /AD /S *.svn*’) DO RMDIR /S /Q %%G

    and run it in the folder you want the .svn folders removed.

    Hope this helps :)

Leave a Reply

Get Adobe Flash playerPlugin by wpburn.com wordpress themes