How do I update a GitHub forked repository?

前端 未结 23 2791
借酒劲吻你
借酒劲吻你 2020-11-21 11:07

I recently forked a project and applied several fixes. I then created a pull request which was then accepted.

A few days later another change was made by another con

23条回答
  •  南笙
    南笙 (楼主)
    2020-11-21 12:03

    A lot of answers end up moving your fork one commit ahead of the parent repository. This answer summarizes the steps found here which will move your fork to the same commit as the parent.

    1. Change directory to your local repository.

      • Switch to master branch if you are not git checkout master
    2. Add the parent as a remote repository, git remote add upstream

    3. Issue git fetch upstream
    4. Issue git rebase upstream/master

      • At this stage you check that commits what will be merged by typing git status
    5. Issue git push origin master

    For more information about these commands, refer to step 3.

提交回复
热议问题