## 第一步
首先右击--git Bash here打开git命令行工具,检查用户名和邮箱是否配置
```
git config --global --list
```

## 第二步
如未配置,则执行以下命令进行配置:
```
git config --global user.name "这里换上你的用户名"
git config --global user.email "这里换上你的邮箱"
```

## 第三步
执行命令生成秘钥:
```
$ ssh-keygen -t rsa -C "这里换上你的邮箱"
```
执行命令后需要进行3次或4次确认:
- 1.确认秘钥的保存路径(如果不需要改路径则直接回车);
- 2.如果上一步置顶的保存路径下已经有秘钥文件,则需要确认是否覆盖(如果之前的秘钥不再需要则直接回车覆盖,如需要则手动拷贝到其他目录后再覆盖);
- 3.创建密码(如果不需要密码则直接回车);
- 4.确认密码如果不需要密码则直接回车);
在指定的保存路径下会生成2个名为id_rsa和id_rsa.pub的文件:**(默认地址:C:\Users\用户名\ .ssh)**

## 第四步
**添加公钥到你的远程仓库(github)**
- 再打开你的github,进入配置页:
- Settings -- SSH and GPG keys (英文路径)
- 设置==》SSH与GPG公钥 (中文路径)
- 新建SSH秘钥
- 在本地使用记事本打开`id_rsa.pub`,然后将里面的字符填充到密钥中,标题可自取(用以规范确认不同的主机)

- 秘钥绑定成功

## 第五步
- 测试链接
```
用ssh链接git:ssh -T git@github.com
```

参考资料:
- 简书:[传送门](https://www.jianshu.com/p/dd3be8cb5b90)
- git下载:[传送门](https://owncloud.gotarget.top/Windows/%E5%BC%80%E5%8F%91%E5%B7%A5%E5%85%B7/%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83/Git/Git-2.35.1.2-64-bit.exe)

关于使用Git配置秘钥链接账户