Remove git directories before incremental caching

Ruby syntax note: you usually want do..end when having multi-line blocks