Zenn
🐷

GitHub + SSH で複数アカウント切替え

2025/03/25に公開

あれこれやっってみたけどキモはここ。

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 が今どきの主流なのか。

https://android.benigumo.com/20250323/github-ssh-multiple-accounts/

Discussion

ログインするとコメントできます