如何合并从基础存储库到分叉存储库的最新更改 [英] How to merge latest changes from a base repo to a forked repo

查看:68
本文介绍了如何合并从基础存储库到分叉存储库的最新更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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.

这篇关于如何合并从基础存储库到分叉存储库的最新更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆