RSS Feed

OSS Ramblings

http://www.ossramblings.com/remove_svn_recursively

 

Recursively Remove .svn Directories in Linux

Subversion is a pain, but without it things can be even worse. Sometimes your workstation will get out of sync with the server or if you're like me you realize that you accidentally FTP'd the entire project directory to the web server including all the hidden subdirectories and don't want that floating around online.

Another mistake I commonly make is using the copy feature to copy a series of directories in Eclipse from one project to another. Unfortunately Eclipse will invariably copy all the Subversion pointers as well, completely breaking the target project's SVN links. In that case, I take the hosed project, move it out of Eclipse entirely, check out the current committed copy, then move all the project files back into place, replacing the just checked out copy - to do this you must first delete all the .svn directories.

There's a quick an easy fix using the console to remove all the .svn directories.

rm -rf `find . -type d -name .svn`

Tada! One line takes care of it all for you, recursively.

I don't do a lot of coding anymore, but for most larger projects I will create a basic framework before I hand it off to the developers assigned to the project. This ensures that everything stays per my coding standards and helps me keep an eye on development since I'm not having to learn a completely different layout. I regularly check the current Subversion editions of all projects we have going.



Hello I use find ./ -name

GnOme's picture

Hello

I use
find ./ -name .svn | xargs rm -fr

to do this

:)

Post new comment

The content of this field is kept private and will not be shown publicly.
If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
Are you a BOT? What's this say?
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.

 
 
 




Image 01 Image 02 Image 03