配置本地ssh
github官方说明: https://help.github.com/en/articles/connecting-to-github-with-ssh
- 生成ssh秘钥
ssh-keygen -t rsa -b 4096 -C "your_email@gitlab.com" -f ~/.ssh/gitlab/id_rsa
- 当前
用户目录/.ssh/
创建config文件 , 保存以下内容
# gitee
Host gitee.com
Port 80 ## 端口号,默认80,可以不写
HostName gitee.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/gitee/id_rsa ## 指定本地私钥文件地址