如何合并从基础存储库到分叉存储库的最新更改
2年前,我分叉了一个git存储库.在那之后,我们在这方面所做的更改不多,但是在许多文件中所做的更改却很少.
2 years ago I had forked a git repository. After that we made some changes on our side not much but we have changed little things in many files.
现在,我们从中分叉了基本git repo中的一些修复功能.从现在开始,我们希望通过保持局部变化不变,将那些变化包括到我们的分叉变化中.
Now there are some fixes+features in base git repo from which we had forked. Since now we want to include those changes to our forked one, by keeping our local changes constant.
是否有任何方法可以将最新的回购变更合并到我们的分叉式回购中,以保持我们的本地变更不变?
Is there any way to merge latest repo changes to our forked repo keeping our local changes as it is?
如果更改被隔离到自己的分支中,则只需从上游存储库中提取更改即可.
If the changes are isolated onto their own branch, then you can simply pull the changes in from the upstream repository.
git pull
请记住,这等效于git fetch && git merge
操作.
Mind you, this is equivalent to a git fetch && git merge
operation.
如果要将这些新更改包括到您的特定分支中,则必须通过git merge
将它们合并.请记住,由于对代码库的修改已超过两年,因此您很可能会遇到合并冲突.到那时,您将要弄清楚从旧版API到新版API的变化,并确定前进的最佳方法.
If you want to include these new changes into your specific branch, you'll have to merge them in via git merge
. Bear in mind, with changes to a code base from over two years old, you'll likely run into merge conflicts. At that point, you'll want to figure out what's changed from the old API to the new API and determine the best way to move forward.