Git: Pull from other remote

前端 未结 2 876
耶瑟儿~
耶瑟儿~ 2020-12-07 10:00

I have created a fork from a project on GitHub. How can I now pull changes from the project that I forked from?

2条回答
  •  执笔经年
    2020-12-07 10:48

    upstream in the github example is just the name they've chosen to refer to that repository. You may choose any that you like when using git remote add. Depending on what you select for this name, your git pull usage will change. For example, if you use:

    git remote add upstream git://github.com/somename/original-project.git

    then you would use this to pull changes:

    git pull upstream master

    But, if you choose origin for the name of the remote repo, your commands would be:

    To name the remote repo in your local config: git remote add origin git://github.com/somename/original-project.git

    And to pull: git pull origin master

提交回复
热议问题