1.检查本机是否有ssh key设置
$ cd ~/.ssh
2.如果没有,使用Git Bash生成新的ssh key
$ ssh-keygen -t rsa -C "xxxxxx@yy.com"
3.本机已完成ssh key设置,其存放路径为:C:\Users\Administrator.ssh
4.添加ssh key到GitHub
Settings→SSH kyes→Add SSH key,复制id_rsa.pub的公钥内容
5.配置账户
$ git config --global user.name “your_username”
$ git config --global user.email “your_registered_github_Email”
6.测试ssh keys是否设置成功。
$ ssh -T git@github.com
The authenticity of host 'github.com (192.X.X.131)' can't be established.
RSA key fingerprint is SHA256:nTabg6kXUpJWGl7E1IGOCspRam1xdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,192.X.X.131' (RSA) to the list of known hosts.
Hi lunabird! You've successfully authenticated, but GitHub does not provide shell access.
大功告成!!