1. 创建私钥
ssh-keygen -t rsa -b 4096 -C "my_work_email@my_company.com"
2. 编辑 ~/.ssh/config 文件
Host github.com HostName github.com User git AddKeysToAgent yes IdentityFile ~/.ssh/id_rsa # Work GitHub account Host github.com-company HostName github.com User git AddKeysToAgent yes IdentityFile ~/.ssh/id_rsa_xadl
3.克隆项目
用 github.com-company 替代克隆链接中的 github.com
git clone git@github.com-work:[my work GitHub group]/[my project].git