I use git for work and most of the time, with a lot of branches. Every time I switch from branch to branch, and do a clean build, Spotlight gets so busy in the background (mds, mdworker). All those indexing work takes a lot CPU time and disk IO. But those efforts are pretty wasted. I use IDE for text search, and in another hour or two, I switch to another branch.
It is possible to suppress some Spotlight activities. From System Preferences, Spotlight, in the privacy tab, put the directory of git repository in the not-to-index list. Save CPU usage, battery, and generate less heat.