Pulling changes from fork parent in Git

前端 未结 2 1830
闹比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: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

提交回复
热议问题