简体   繁体   中英

Pull changes from original master to branch on fork

I forked project created branch made some changes on it and created pull request. Repo owner added some minor changes to master. I need to pull this changes from original project master to my fork branch.

I tried

git fetch origin

but nothing happens.

If you try git remote -v you'll notice that origin points to your fork and not to the original repository.

In order to get changes from the original one, you should add a new remote:

git remote add upstream <URL>

and then pull changes from that remote:

git fetch upstream

Now if you show the remotes again, you should have something like:

$ git remote -v
origin    https://github.com/... (fetch)
origin    https://github.com/... (push)
upstream  https://github.com/... (fetch)
upstream  https://github.com/... (push)

Note that the name upstream is not special, you can set it to whatever you want.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM