There are no "usernames" in Git.
When creating a commit with Git it uses the configuration values of user.name
(the real name) and user.email
(email address). Those config values can be overridden on the console by setting and exporting the environment variables GIT_{COMMITTER,AUTHOR}_{NAME,EMAIL}
.
Git doesn't know anything about github's users, because github is not part of Git. So you're only left with an API call to github (I guess you could do that from the command line with a little scripting.)