🐷
GitHub + SSH で複数アカウント切替え
あれこれやっってみたけどキモはここ。
❯ vi ~/.ssh/config
Host github-main
HostName github.com
User git
Port 22
IdentityFile ~/.ssh/id_ed25519_main
TCPKeepAlive yes
IdentitiesOnly yes # need for multiple accounts
Host github-sub
HostName github.com
User git
Port 22
IdentityFile ~/.ssh/id_ed25519_sub
TCPKeepAlive yes
IdentitiesOnly yes # need for multiple accounts
Git HTTPS + Credential Manager がまあややこしくてクソ。
鍵の生成は ed25519
が今どきの主流なのか。
Discussion