项目传输方式: SSH(内附GitHub配置SSH Key)
2019-10-09 本文已影响0人
下班不写程序
1. 通过一张简图来了解ssh传输方式:
image.png
原理分析
2. 演练GitHub配置SSH Key
1. 设置git的user name和email
git config --global user.name "你的名字"
git config --global user.email "你的邮箱"
2. 检查是否存在SSH Key
cd ~/.ssh
ls
或者
ll
//看是否存在 id_rsa 和 id_rsa.pub文件,如果存在,说明已经有SSH Key
3. 没有SSH Key,生成.
ssh-keygen -t rsa -C "你的邮箱"
4. 获取SSH Key
cat id_rsa.pub
// 然后拷贝添加到github即可
Mac桌面前往文件夹 command + shift + g 输入 ~/.ssh回车, 就能找到对应的ssh文件夹image.png