打开终端输入 cd ~/.ssh
输入你的邮箱 ssh-keygen -t rsa -C 'your@qq.com'
生成秘钥 在C:\Users\名字.ssh
看到这句后 就说明你操作的没错 Generating public/private rsa key pair.
输入用户名密码阶段 可以直接 enter 跳过
接着输入 cat ~/.ssh/id_rsa.pub
就出来了 将内容复制到gitlab上设置 ssh密钥的地方
点击add ssh key
在git中输入命令 ssh -T git@github.com
然后会跳出一堆话。。
输入命令:yes
回车
然后就会提示你成功了~~
----后续报错
Permanently added 'github.com,20.205.243.166' (ECDSA) to the list of known hosts. git@github.com: Permission denied (publickey).
git "fatal: Could not read from remote repository.
输入git pull --rebase解决