# 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中便可。