1.查看电脑是否存在SSH Key。C盘->用户->自己的用户名->.ssh
下是否有id_rsa
、id_rsa.pub
文件,如果没有需要手动生成。
2.如果没有配置
2.1配置
git config –global user.name ‘xxxxx’ //git用户名
git config –global user.email ‘xxx@xx.xxx’ //git邮箱
2.2 生成密钥
ssh-keygen -t rsa -C ‘上面的邮箱’ 之后按三个空格
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/Mr.Yang/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/Mr.Yang/.ssh/id_rsa.
Your public key has been saved in /c/Users/Mr.Yang/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:zA6wNJrFB6NcqS6eBog/AHlzQuvFjYpG759Yhh1lWGI xxxxxx@xxxxx.xxx(上面自己的邮箱)
The key's randomart image is:
+---[RSA 2048]----+
| +E . |
| ..+oo+ |
| oo+*+.o |
|o.*===+o |
|==+*... S |
|B.+.o .o