美文网首页git
github fork后怎样再更新

github fork后怎样再更新

作者: 谢昆明 | 来源:发表于2017-07-02 09:22 被阅读128次

    以neovim为例
    https://github.com/neovim/neovim

    1. 从界面上fork一份到自己的仓库

    git clone git@github.com:ckelsel/neovim.git

    2.

    cd neovim git remote add upstream https://github.com/neovim/neovim

    3.

    git remote -v
    origin git@github.com:ckelsel/neovim.git (fetch)
    origin git@github.com:ckelsel/neovim.git (push)
    upstream https://github.com/neovim/neovim (fetch)
    upstream https://github.com/neovim/neovim (push)

    4.

    git fetch upstream
    remote: Counting objects: 29, done.
    remote: Compressing objects: 100% (3/3), done.
    remote: Total 29 (delta 16), reused 18 (delta 16), pack-reused 10
    Unpacking objects: 100% (29/29), done.
    From https://github.com/neovim/neovim

    • [new branch] master -> upstream/master

    5. 检出本地最新的版本

    git checkout master

    6. merge

    git merge upstream/master

    参考:
    https://help.github.com/articles/syncing-a-fork/

    打赏

    如果这篇文章解决了您的问题,让我买根烟抽抽。

    支付宝.jpg 微信.jpg

    相关文章

      网友评论

        本文标题:github fork后怎样再更新

        本文链接:https://www.haomeiwen.com/subject/tlgwcxtx.html