1. 设置Git用user name和email
git config --global user.name "XXX"
git config --global user.email "XXX@gmail.com"
2. 生成密钥
ssh-keygen -t rsa -C "XXX@gmail.com"
中间连续3次Enter键.
3. 测试SSH key是否设置成功
ssh -T git@github.com
出现下面提示直接输入yes.
The authenticity of host 'github.com (192.30.253.113)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUptrewtretrGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? yes
输出如下,则表示通过.
Hi xxxx! You've successfully authenticated, but GitHub does not provide shell access.
使用时,会根据本地git密钥信息与git或者coding仓库密钥信息比对,本地上传时会提示登录。
评论 (0)