Pulling changes from fork parent in Git

前端 未结 2 1827
闹比i
闹比i 2021-01-31 00:08

How do you pull changes from the parent of a fork in Git, specifically in a github configured project?

For example, say I forked http://github.com/originaluser/originalp

相关标签:
2条回答
  • 2021-01-31 00:28

    You can add the parent repository (upstream) as another remote branch. Something like

    git remote add upstream ...
    

    and then you can just git fetch to see any changes and then rebase/merge... whatever.

    0 讨论(0)
  • 2021-01-31 00:43

    Expanding on other answers, these are the steps I took on a fork I had of tsc-watch:

    git remote add upstream https://github.com/gilamran/tsc-watch.git
    git fetch upstream
    git merge upstream/master
    git push
    

    Explained:

    1. adding the remote server as upstream
    2. fetch all changes from upstream
    3. merge changes from upstream branch into my master branch
    4. push all changes to github
    0 讨论(0)
提交回复
热议问题