このようにGithubアカウントとgitユーザというのは、少なくとも日頃のGithub利用においては、無関係である。日頃、適当なusername, emailで手元のgitリポジトリにコミットしまくって、Githubアカウントを使ったgit protocol (ssh)接続でpushするとき、接続においてGithubアカウントとSSH鍵は使われるが、、、T.B.D.。
というわけで、Github上のリポジトリを操作したりそれにアクセスしたりするときに意味があるのは、(Githubアカウントに紐付けられた)SSH鍵だけであり、gitのconfigは、(ユーザについては)無関係である。そのためGithubにたいしてgit protocolを使う前にssh -T等でgit@github.comと適切な鍵のバインドをssh-agentに登録することが必要になる。例えば次のように。
(Created a new reporsitory with the name 'toy-programs' on the Github page)
$ mkdir toy-programs
$ cd toy-programs
$ git init
Initialized empty Git repository in /Volumes/ExDrive3/git-repos/local/toy-programs/.git/
$ git config user.email "aka.cs.mail@gmail.com"
$ git config user.name "aka"
$ touch README
$ git add README
$ git commit -m 'first commit'
[master (root-commit) bc6a24e] first commit
0 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 README
$ git remote add origin git@github.com:akacs/toy-programs.git
$ ssh-add -D
$ ssh -T git@github.com -i ~/.ssh/ssh-userkey-personel.bastion-XXX-20120128
Identity added: [...]/.ssh/ssh-userkey-personel.bastion-XXX-20120128 ([...]/.ssh/ssh-userkey-personel.bastion-XXX-20120128)
Hi akacs! You've successfully authenticated, but GitHub does not provide shell access.
$ git push -u origin master
Counting objects: 3, done.
Writing objects: 100% (3/3), 203 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
To git@github.com:akacs/toy-programs.git
* [new branch] master -> master
Branch master set up to track remote branch master from origin.
$