Find files/dirs recursively and do something

The following will find all files in the current directory and all of current subdirectories matching .git* and delete them:

sudo find ./ -type f -name '.git*' -exec rm  {} \;

The following will find all directories named .git in the current dir and subdirs and delete them:

sudo find ./ -type f -name .git -exec rm  {} \;

Notice how you escape the asterisk by including it within a pair of single quotes.

SVN replace local files/dirs with the ones from repo

I used to think that SVN has some kind of 'replace' command, as this is present in SVN plugin in Eclipse. But now that I turn to using SVN from the Mac terminal,, I find out that this is not the case. SVN does *not* have replace command. But there's a trick to achieve the replace functionality:

rn -rf baddirectory
svn update baddirectory