1. 创建对应的key:
ssh-keygen -t rsa -C "xuewenwang888@gmail.com"
2. 输入文件名:
/home/wang/.ssh/id_rsa_wang
3. 将公钥添加到github的SSH keys列表里:
cat ~/.ssh/id_rsa_wang.pub
4. 在仓库路径添加local账号
git config --local user.email xuewenwang888@gmail.com
git config --local user.name xuewenwang
5. vim ~/.ssh/config
Host github.com
User xuewenwang888@gmail.com
Hostname github.com
IdentityFile ~/.ssh/id_rsa_wang
6. ssh-add /home/wang/.ssh/id_rsa_wang