【问题标题】:Octopress and github confusionOctopress 和 github 混淆
【发布时间】:2013-09-09 11:55:34
【问题描述】:

我是 Octopress 的新手,对 git/github 也比较陌生。

我在本地克隆 (installed/setup) Octopress 存储库:

git clone git://github.com/imathis/octopress.git sitename
cd sitename
bundle install
rake install

酷 - 现在我有了 Octopress 的源代码和本地驱动器上的骨架站点。

问题 1 - 更新

根据docs,我应该能够通过以下方式更新到最新的 Octopress 更改:

git pull octopress master     # Get the latest Octopress
bundle install                # Keep gems updated
rake update_source            # update the template's source
rake update_style             # update the template's style

但这会导致错误:

[sitename]$ git pull octopress master
fatal: 'octopress' does not appear to be a git repository
fatal: Could not read from remote repository.

为什么会失败?

问题 2 - “我的”东西在哪里?

现在我需要为我创建的资产创建自己的 github 存储库,对吗?如果是这样,我是在其中存储所有内容,还是只存储特定于我的博客的内容(帖子、页面等)?我的猜测是我必须在 github 上创建一个 repro 并将我的更改推送到那里......但同样,我不确定这是否正确。任何建议将不胜感激。

【问题讨论】:

  • git pull octopress master 中,是否也应该像在安装中那样用站点名称替换那个八角机?

标签: git octopress


【解决方案1】:

回答问题 2:

Octopress 存储库有两个分支,sourcemastersource 分支包含用于生成博客的文件,master 包含博客本身(您的帖子等)。

根据Octopress Setup Guide初始配置本地文件夹时,主分支存储在名为“_deploy”的子文件夹中。由于文件夹名称以下划线开头,当您git push origin source 时会忽略它。相反,当您rake deploy 时,master 分支(包含您的博客文章)会更新。

您可能会发现 this blog post 很有帮助。

【讨论】:

    【解决方案2】:

    您应该在您的存储库中有一个名为 octopress 的遥控器来执行此操作:

    [sitename]$ git pull octopress master
    

    尝试添加一个名为octopress 的遥控器并将其指向https://github.com/imathis/octopress.git

    git remote add octopress github.com/imathis/octopress.git
    

    【讨论】:

    • "git remote add octopress github.com/imathis/octopress.git" 添加了遥控器,现在“git pull octopress master”似乎可以工作了。想知道为什么这不是 Octopress 设置/安装的一部分吗?
    【解决方案3】:

    octopress 文档有些地方有点松懈。它描述了当您使用 github 页面作为部署时制作 octopress 远程:http://octopress.org/docs/deploying/github/

    这个信息应该(我认为)预先添加,因为大多数人可能希望在他们自己的名为 origin 的远程仓库中维护他们的博客。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-04-04
      • 2019-10-01
      • 2016-07-11
      • 2013-11-06
      • 1970-01-01
      • 2021-04-10
      • 2021-11-06
      • 2011-12-04
      相关资源
      最近更新 更多