美文网首页
Git - 4.配置SSH

Git - 4.配置SSH

作者: blurryssky | 来源:发表于2016-04-02 14:20 被阅读26次

创建SSH Key

ssh-keygen -t rsa -C "youremail@example.com"

提示输入都可以不填,一路回车直到完成

ls /Users/blurryssky/.ssh

可以看到id_rsaid_rsa.pub两个文件已经生成了
id_rsa是私钥,id_rsa.pub是公钥
选中Finder,按下cmd + shift + g
前往

/Users/blurryssky/.ssh/

打开id_rsa.pub,复制其内容

添加SSH Key

登陆GitHub,打开settingsSSH Keys页面,点New SSH Key
填上任意Title,在Key文本框里粘贴id_rsa.pub文件的内容
点击Add SSH key

add SSH KEY.png

GitHub允许添加多个Key
假定你有若干电脑,你一会儿在公司提交,一会儿在家里提交,只要把每台电脑的Key都添加到GitHub,就可以在每台电脑上往GitHub推送了

相关文章

网友评论

      本文标题:Git - 4.配置SSH

      本文链接:https://www.haomeiwen.com/subject/qonylttx.html