因此,如果..
$ git config user.name
↳ Alex Gray              # OK (my name)
$ git config user.email
↳ alex@mrgray.com        # OK (my email).
和..
GithubUserForProject() {  # in pwd
    ORIGIN=$(git config --get remote.origin.url) && echo $ORIGIN
    OWNER=${ORIGIN%/*}     && echo $OWNER  # trim URL tail
    OWNER=${OWNER#*.com/}  && echo $OWNER  # trim URL head
    OWNER=${OWNER#*:}      && echo $OWNER  # trim ssh URL head
}
$ cd /local/git/MyGitHubRepo && GithubUserForProject
↓ git@github.com:mralexgray/MyGitHubRepo.git
↓ git@github.com:mralexgray
↳ mralexgray            # OK (my username, but skanky way of finding it) 
但...
$ cd /local/git/SomeGuysProject && GithubUserForProject
↓ git://github.com/someguy/SomeGuysProject.git
↓ git://github.com/someguy
↳ someguy              # WRONG! (cloned repo's user!)
那么,我如何以编程方式确定我的 github“短用户名”,无论是从envIronment、github API 请求等还是以其他方式(通过脚本或终端会话?