Cloning into 'octopress'...
The authenticity of host 'github.com (192.30.252.131)' 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
Warning: Permanently added 'github.com,192.30.252.131' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
说明你的电脑不被github信任,需要在你电脑上创建ssh key并添加到github中。
这是你需要执行2;
如果没出现上述错误,直接执行3。
2.创建并添加ssh key
2.1 创建ssh key
2.1.1 生成key
执行命令:
1
$ ssh-keygen -t rsa -C "your_email@example.com"
会提示:
12
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/you/.ssh/id_rsa): [Press enter]
这时候按回车键(Enter)继续:
12
Enter passphrase (empty for no passphrase): [Type a passphrase]
# Enter same passphrase again: [Type passphrase again]
会要求你输入一个密码,4位以上,要记住,后面有用。
接下来会提示:
1234
Your identification has been saved in /Users/you/.ssh/id_rsa.
# Your public key has been saved in /Users/you/.ssh/id_rsa.pub.
# The key fingerprint is:
# 01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db your_email@example.com
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如果打印以下内容,就说明OK了:
1
Hi username! You've successfully authenticated, but GitHub does not
3.clone master分支
下面需要将master分支clone到_deploy目录:
12
$ cd octopress
$ git clone git@github.com:username/username.github.com.git _deploy
4.配置环境
执行以下命令配置环境:
1234
$ gem install bundler
$ rbenv rehash # If you use rbenv, rehash to be able to run the bundle command
$ bundle install
$ rake setup_github_pages
执行最后一条命令时需要你输入github中博客仓库地址:
12
Enter the read/write url for your repository
(For example, 'git@github.com:your_username/your_username.github.com)