Find all directories within two levels of the current directory, delete them if they are empty or if they are named ".git", and execute the removal command.
find ~ -maxdepth 2 -type d \( -empty -or -name ".git" \) -exec rm -r {} \;