安装准备软件
- Node.js
- Git
打开 Git Bash
hexo文件夹,右键:
配置SSH Keys
检查SSH keys设置,看一下电脑现有的ssh key
cd ~/. ssh 检查本机的ssh密钥
如果提示:
No such file or directory
说明是第一次使用git
生成新的SSH Key:
ssh-keygen -t rsa -C "邮件地址@youremail.com" # -C大写,无需引号 Generating public/private rsa key pair. Enter file in which to save the key (/Users/your_user_directory/.ssh/id_rsa):<回车就好>
然后输入密码,可以回车跳过,密码是防止别人往你的项目中提交内容:
Enter passphrase (empty for no passphrase):<输入加密串> Enter same passphrase again:<再次输入加密串>
显示成功设置ssh key:
添加SSH Key到GitHub上
- 找到刚才生成的id_rsa.pub文件,复制所有内容;
- 登录github, 点击右上角的 Account Settings--->SSH Public keys ---> add another public keys
- 粘贴,然后保存
测试
可以输入下面的命令,看看设置是否成功,[email protected]的部分不要修改:
ssh -T [email protected] The authenticity of host ‘github.com (207.97.227.239)‘ can‘t be established. RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48. Are you sure you want to continue connecting (yes/no)? # 直接输入yes Hi cnfeat! You‘ve successfully authenticated, but GitHub does not provide shell access
搞定收工。。。
参考: http://www.jianshu.com/p/05289a4bc8b2
时间: 2024-10-12 15:31:58