简体   繁体   English

将更改从原始主机拉到分支上

[英]Pull changes from original master to branch on fork

I forked project created branch made some changes on it and created pull request. 我分叉的项目created分支对其进行了一些更改并创建了pull请求。 Repo owner added some minor changes to master. 回购所有者对母版进行了一些小的更改。 I need to pull this changes from original project master to my fork branch. 我需要将此更改从原始项目母版拉到我的fork分支。

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. 如果尝试使用git remote -v您会注意到origin指向您的fork而不是原始存储库。

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. 请注意, upstream名称并不特殊,您可以将其设置为所需的名称。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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