user.name
ではなく、 credential.username
を設定しておけばGitHubに接続する時のユーザー名を指定できる。
git config credential.username peccu
osxkeychainを使っている場合は別のリポジトリを使うときに使った設定が引き継がれて、こんなエラーを吐く。(superuserより)
remote: Permission to username1/repo.git denied to username2. fatal: unable to access 'https://github.com/username1/repo.git/': The requested URL returned error: 403
Acceptedじゃない回答が求めていたものだった。