cd ~/.ssh ssh-keygen -t rsa -C {Githubメールアドレス} -f {作成する鍵の名前} Generating public/private rsa key pair. Enter passphrase (empty for no passphrase): Enter same passphrase again:
Host github.sub # サブアカウント HostName github.com User git Port 22 IdentityFile ~/.ssh/private # サブアカウント用の鍵 TCPKeepAlive yes IdentitiesOnly yes
↓参考
.ssh/configファイルでSSH接続を管理する - Qiita
pbcopy < ~/.ssh/private.pub
Adding a new SSH key to your GitHub account - GitHub Help
ssh -T git@github Hi hogehoge! You've successfully authenticated, but GitHub does not provide shell access.
subに切り替え
ssh -T git@github.sub Hi hogehoge! You've successfully authenticated, but GitHub does not provide shell access.
subの方のローカルを変更する。直接vim .git/config変えても良い
git config --local user.name {ユーザー名} git config --local user.email {メールアドレス}