# ls -al ~/.sshvim
>> 若是vim输出的是以下内容:证实本地没有生成的SSH Key,请执行第二步。app
# No such file or directoryssh
>> 若是vim输出的是以下内容: 证实本地已经存在SSH Key 文件,请执行第四步。terminal
# id_rsa id_rsa.pubit
#ssh-keygen -t rsa -C"you_email"email
your_email:这里填写你在GitLab或者GitHub注册时的邮箱。file
后面的提示直接敲回车,一路完成。rsa
# ssh-add ~/.ssh/id_rsaim
# cat /Users/xxx/.ssh/id_rsa.pubssh-key
xxx是你的电脑用户名,例如:howieMacBook-Pro:~ howie$中的howie关键字。
复制生成好的SSH Key 添加到 GitLab 或者GitHub中的SSH Key中便可。