How can I keep a git fork updated? [duplicate]

夙愿已清 提交于 2019-12-02 02:49:28

问题


Possible Duplicate:
Can I update a forked project, on git, to the original/master copy?

Let's say I fork a project, and then clone it down to my machine.

At this point, git pull, as well as git fetch and git rebase origin/branch_name, refer to my forked repository. If I wanted to rebase to the original repository's master, how would I go about doing this?


回答1:


Add the original repo as a remote

git remote add upstream git@github.com:<OriginalUser>/<OriginalRepo>.git

then rebase from there

git fetch upstream
git rebase upstream/master


来源:https://stackoverflow.com/questions/14534677/how-can-i-keep-a-git-fork-updated

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!