Wednesday, July 3, 2013

Recursive Deletion of .svn directories

After some evil bad version control errors by some crazy lunatic people I had to clean up svn for a project. The problem was that the files were added to svn on two different checkouts. When trying to do an update on one after a commit on the other it freaked the hell out. So i needed to recheckout a clean version and then copy the new files over the top of the other files. This does have the problem of loosing code, but I am doing it for the production copy which should be the primary code.

Here is how I cleaned up the live copy so I could copy those changes over the top of the clean checkout without copying the svn files over the top also.

find . -type d -name .svn -exec rm -rf {} \; # linux command line

the . in the find means start from the current directory.  the d is for types of file equals directories. the .svn is the name of the directories and finally rm -rf is the command to execute on each found item.