find . -name .git -type d -exec dirname {} \;
.specifies the path to search.-type dmakes 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.