如何将回购镜同步到新的上游回购 [英] how to sync a repo mirror to a new upstream repo

查看:146
本文介绍了如何将回购镜同步到新的上游回购的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个最初创建镜像回购镜像服务器(myrepo)和
与远程(repoA)同步。也就是说,我用像下面这样来创建它。

I have a repo mirror server (myrepo) that was originally created to mirror and sync with a remote (repoA). That is, I used something like the following to create it.

cd myrepo
repo init -u git://repoA-server/manifest.git --mirror
repo sync

...然后我修改清单文件的获取行使用myrepo服务器
这样用户就可以从myrepo镜克隆

...then I modified manifest file's fetch line to use myrepo server so users can clone from myrepo mirror

所以,现在repoA消失了,不存在了。它已被替换为新的
在不同的URL已经修改了一些树枝,并使用repoB服务器
新清单文件对于那些分支机构。

So now repoA is gone and doesn't exist anymore. It has been replaced with a new repoB server at a different URL which has modified some of the branches and uses a new manifest file for those branches.

我怎样才能重新同步我的myrepo镜子用这个新repoB?我不想吹走
我myrepo,只是创建一个新的镜像。我要保留它的历史和刚
更新一些分支到现在从repoB跟踪,并使用新的清单
文件(我将再次修改从myrepo获取项目)。

How can I resync my myrepo mirror with this new repoB? I don't want to blow away my myrepo and just create a new mirror. I want to retain its history and just update some of the branches to now track from repoB, and use the new manifest file (which I will again modify to fetch projects from myrepo).

我不知道如何去这样做呢?我想知道如果我可以简单地做一些
改变myrepo然后只需运行回购同步,以让它同步了新镜
(即做一个获取/合并更新分支)?还是我要克隆myrepo然后
做这样的事情添加repoB为远程,创建跟踪分支,取/合并我自己,
并努力推动,截至myrepo?

I'm not sure how to go about doing this? I'm wondering if I can simply make some change in myrepo and then just run 'repo sync' to have it sync up with new mirror (i.e. do a fetch/merge for updates branches)? Or do I have to clone myrepo then do something like add repoB as a remote, create tracking branches, fetch/merge myself, and try to push that up to myrepo?

推荐答案

继续前进并更改网址/在配置文件路径:

go ahead and change the urls/paths in the config file:

.git/config

这将是最快的方式。虽然可以解决每个分支设置与命令。

That would be the fastest way. Although you could address each branch setup with commands.

另外,请注意,你会不会丢失任何历史,如果你要重新克隆如果他们是同步的。你会失去除其他事项外reflog以及运行RR-缓存。

Also, please note that you would not lose any history if you were to reclone if they are in sync. You would lose your reflog and rr-cache among other things.

希望这有助于。

亚当

这篇关于如何将回购镜同步到新的上游回购的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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