find . -name .git -type d -exec dirname {} \;
.
specifies the path to search.-type d
makes this only apply to directories.-name ...
specifies the name of the directories this should apply to.-exec ... {} +
is the command that will be run for each match.