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 “サブアカメールアドレス”

![image](https://github.com/user-attachments/assets/c29641e8-5e5c-422a-9e2b-d59b666a647c)

![image](https://github.com/user-attachments/assets/d2c267b5-1f63-4a78-8727-f59909a0fc31)
![image](https://github.com/user-attachments/assets/425aac95-2ad5-4a6a-8625-acd61578d65b)

⚠️ **GitHub.com Fallback** ⚠️