While its true that git commits don't have a specific field called "username", a git repo does have users, and the users do have names. ;) If what you want is the github username, then knittl's answer is right. But since your question asked about git cli and not github, here's how you get a git user's email address using the command line:
To see a list of all users in a git repo using the git cli:
git log --format="%an %ae" | sort | uniq
To search for a specific user by name, e.g., "John":
git log --format="%an %ae" | sort | uniq | grep -i john