1,生成 SSH key
- 右键打开 Git Bash
- 粘贴如下的命令,并将email address替换为注册 Github 账号时填写的邮箱:ssh-keygen -t rsa -b 4096 -C "email address"
- 连续敲击 3 次回车,即可在 C:\Users\用户名文件夹\.ssh 目录中生成 id_rsa 和 id_rsa.pub 两个文件
2,配置 SSH key
- 使用记事本打开 id_rsa.pub 文件,复制里面的文本内容
- 在浏览器中登录 Github,点击头像 -> Settings -> SSH and GPG Keys -> New SSH key
- 在 Title 文本框中任意填写一个名称,来标识这个 Key 从何而来
- 将 id_rsa.pub 文件中的内容,粘贴到 Key 对应的文本框中
3, 连接
在创建新的repositroy完成时会自动跳转一个页面找到如下命令在终端执行然后刷新github页面就可以看到啦![](https://i-blog.csdnimg.cn/blog_migrate/6d804f05c5a463f68363624593236613.png)