Mac版本:
step1:查看是否已存在
终端输入:
ls -al ~/.ssh
如果提示No such file or directory,则说明没有,需要新生成
如果出现`id_rsa id_rsa.pub两个文件,说明已经有了,直接通过step4查看
step2:新生成
终端输入:
ssh-keygen -t rsa -C"you_email
your_email填写你在GitLab或者GitHub注册时的邮箱
后面的提示直接敲回车,一路完成
step3:生成并添加SSH Key
ssh-add ~/.ssh/id_rsa
step4:查看SSH Key
cat /Users/xxx/.ssh/id_rsa.pub
xxx替换成你自己的