git

github fork后怎样再更新

2017-07-02  本文已影响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

5. 检出本地最新的版本

git checkout master

6. merge

git merge upstream/master

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

打赏

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

支付宝.jpg 微信.jpg
上一篇下一篇

猜你喜欢

热点阅读