【问题标题】:How to update a forked Jekyll GitHub blog from the original repository?如何从原始存储库更新分叉的 Jekyll GitHub 博客?
【发布时间】:2015-05-21 12:38:09
【问题描述】:

我在这里有一个博客的 GitHub 存储库:https://github.com/andrerpena/andrerpena.github.io

这个仓库是这个仓库的一个分支:https://github.com/barryclark/jekyll-now

我要做的是根据我派生的存储库更新我的存储库。我没有 Git 经验,所以我正在尝试关注 this tutorial。但它不起作用,因为我似乎没有 upstream 分支。

我该怎么办?

编辑

在@sircapsalot 的建议之后,我现在似乎已经正确配置了upstream 分支:

但我不知道该怎么办。

【问题讨论】:

    标签: git github jekyll


    【解决方案1】:

    如果您使用的是 CLI:

    $ pwd
    /users/.../andrerpena.github.io
    $ git remote add upstream git@github.com:barryclark/jekyll-now.git
    $ git pull --rebase upstream master
    

    您没有upstream 的原因是您没有阅读:)

    转到that page

    【讨论】:

    • 感谢您的帮助。 rebase 命令到底有什么作用?它是否将我当前的分支从master 切换到upstream
    • 嗯,它会有所不同.. 有时您可能只想像文档所述那样做一个merge。但在这种情况下,--rebase 将执行以下操作:fetch from upstream master, make your current branch at the upstream master version, fast forward your commits onto the branch
    • 再次感谢。看来我没有从远程目录读取的权限:i.imgur.com/HigulLs.png。这应该发生吗?
    • 我按照您链接的页面进行操作,看来我的遥控器配置正确:i.imgur.com/dpI0Gbj.png
    • 您可能没有正确配置 ssh。使用git remote add upstream https://github.com/barryclark/jekyll-now.git 而不是git@github.com...。但是,在这样做之前,您需要删除 upstream 才能再次添加它。 git remote rm origin, 那么 git remote add...
    猜你喜欢
    • 2011-04-23
    • 1970-01-01
    • 2012-10-05
    • 1970-01-01
    • 2013-04-18
    • 1970-01-01
    • 1970-01-01
    • 2013-03-16
    相关资源
    最近更新 更多