Home - TTThiro/git GitHub Wiki
1.メイン(primary)・サブ用メールアドレスでGitHubにアカウントを作成する
2. パソコンでメイン/サブ用のsshキー作成
ssh-keygen -t ed25519 -C “メールアドレス” -f “鍵名”
ssh-keygen -t ed25519 -C “メールアドレス(サブ用)” -f “鍵名_sub”
3. ~/.ssh/config ファイル作成し追記
Host primary
HostName github.com
IdentityFile ~/.ssh/id_rsa_github
User git
Host sub
HostName github.com
IdentityFile ~/.ssh/id_ed25519_sub
User git
4. GitHub(サブアカウント)に公開鍵を登録する (Settings)
5. 疎通確認
ssh -T primary Hi ○○! You’ve successfully authenticated, but GitHub does not provide shell access.
ssh -T sub Hi ○○! You’ve successfully authenticated, but GitHub does not provide shell access.
6. 運用時の設定 ( gitconfig, clone など)
[サブアカでログインしたリポフォルダにする]
git config —local user.name “サブアカ名”
git config —local user.email “サブアカメールアドレス”


