设置Github SSH
设置用户名和邮箱
如果是在本机上首次安装Git,在Git Bash下面首先配置用户名和邮箱
git config --global user.name "yourname"
git config --global user.email "youremail" -- 我没有试过和Git注册邮箱不一致是否ok,理论上可以不一致
生成SSH秘钥
git
$ ssh-keygen -t rsa -C "youremail"
默认路径和文件在
c:\user\.ssh下
打开.pub后缀文件,复制后粘贴在Github的SSH设置中。公钥可以发布出去,私钥不可以。
测试联通性
$ ssh -T git@github.com
# Attempts to ssh to GitHub
拉取代码![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/1c7b1fefebf9805ade10668082a01723.png)
git clone + 复制下来的代码