My Octopress Blog

A blogging framework for hackers.

Accidentally Deleting All the .svn Folders

I did something really stupid today. I deleted all of the .svn folders in my project before committing my changes, and after building a major addition to it. I was trying to delete them from another folder, and used the wrong terminal window. :|

Anyway, point being, I fixed it!

Here is what I did:

> pwd
~/Development/project_name/
> cd ..
> svn co http://svn.domain.com/repo/trunk/ project_name_temp/
> cd project_name_temp
> find .  -type d -name ".svn" -exec mv -f '{}' ../project_name/log/.'{}'  \;
find: ./app/.svn: No such file or directory
find: ./app/apis/.svn: No such file or directory
(repeated.. this is normal)
> cd ..
> rm -R project_name_temp/

The key was:

find .  -type d -name ".svn" -exec mv -f '{}' ../project_name/log/.'{}'  \;