开发者

Git: Pull from other remote

开发者 https://www.devze.com 2022-12-19 21:35 出处:网络
I have created a fork from a project on GitHub. How can I now pull开发者_高级运维 changes from the project that I forked from?git pull is really just a shorthand for git pull <remote> <branch

I have created a fork from a project on GitHub. How can I now pull开发者_高级运维 changes from the project that I forked from?


git pull is really just a shorthand for git pull <remote> <branchname>, in most cases it's equivalent to git pull origin master. You will need to add another remote and pull explicitly from it. This page describes it in detail:

http://help.github.com/forking/


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

0

精彩评论

暂无评论...
验证码 换一张
取 消