- 第一步:生成 ssh 公私钥
ssh-keygen -t rsa -C“邮箱”
- 第二步:创建配置文件
# 配置 github.com
Host github.com
HostName github.com
IdentityFile C:\Users\chao\.ssh\id_rsa_github
PreferredAuthentications publickey
User 1326330617@qq.com
# 配置 gitee.com
Host gitee.com
HostName gitee.com
IdentityFile C:\Users\chao\.ssh\id_rsa_gitee
PreferredAuthentications publickey
User 1326330617@qq.com
# 配置 gitlab
Host *.*.*.*
HostName *.*.*.*
IdentityFile C:\Users\chao\.ssh\id_rsa_gitlab
PreferredAuthentications publickey
User yanglichao
- 第三步:将公钥放置到版本仓库
不会去百度