The exclude-dir option works nicely, I was previously was using –exclude and it would include some sub-dir .svn files
egrep –exclude-dir=.svn -r -n {search-criteria} {directory}i.e. find all TODO comments in the current directory and all sub directories
egrep –exclude-dir=.svn -r -n TODO .
Found this in the comments on this post - http://antoniolorusso.com/2008/05/12/grep-excluding-svn-dirs/
.