简体   繁体   English

如何用我从本地存储库的主分支派生的原始存储库更新派克的本地分支?

[英]How to update my local branch of fork with original repository from which i forked the master branch of local repository?

Suppose i clone from a repository foo 假设我从存储库foo中克隆

I get a local copy name my/foo 我得到一个本地副本名称my / foo

I then create a branch mybranch/foo . 然后,我创建一个分支mybranch / foo Then i made some commits into mybranch/foo while some PR's get merged in foo remote repository( remote repository ) . 然后我对mybranch / foo进行了一些提交,而一些PR被合并到foo远程存储库(remote repository)中。 I wan to merge my local branch mybranch/foo into foo but to do this i have to get all those changes which have taken place in foo while retaining changes which i have made in mybranch/foo . 我想将我的本地分支mybranch / foo合并到foo中,但是要做到这一点,我必须保留在foo中发生的所有更改,同时保留在mybranch / foo中所做的更改。

I have tried using git rebase upstream/master and git merge upstream/master but i have not got the desired result . 我尝试使用git rebase上游/主和 git merge上游/主,但我没有得到想要的结果。 but i have not got the desired result . 但是我没有得到理想的结果。 Above methods work for master of local repository but not for mybranch/foo . 上面的方法适用于本地存储库的主机 ,但不适用于mybranch / foo I want to know the best way of doing this . 我想知道最好的方法。

git pull is what you are looking for: git pull是您要寻找的:

git pull origin master

read this for more details. 阅读以获取更多详细信息。

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

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