1、首先安装Git工具,运行Git Bash,输入指令进入.ssh文件夹(位置在桌面)
cd ~/.ssh/
2、 如果提示 “ No such file or directory”,你可以手动的创建一个 .ssh文件夹即可
mkdir ~/.ssh
3、 配置全局的name和email,github的name和email
git config --global user.name "yourname"
git config --global user.email "youremail@outlook.com"
4、生成key
ssh-keygen -t rsa -C "youremail@outlook.com"
连续按三次回车,这里设置的密码就为空了,并且创建了key。
最后得到了两个文件:id_rsa和id_rsa.pub