Sunday, February 28, 2010

Remove the annoying .svn dirs

While moving a Subversion repo to Git, I again was reminded how much I like Git and it's simplicity with regards to what metadata it stores and needs to run.

The particular issue is one most SVN users are familiar with, the .svn hidden dirs. There is one for every directory in a SVN project. With Git there is just one up at the top of each project. The .git directory serves the same purpose and only intrudes in one place. A perfect example of the DRY principle at work

Anyway, I wrote this little command line script to get rid of the annoying .svn dirs when I copied the repo over to what will be it's new Git home.


find . -name ".svn" -exec rm -rf '{}' \;


It finds the .svn dirs and removes them forcefully. I know it's not a big revelation, but it is handy.

No comments: