如何将存储库镜像同步到新的上游存储库
我有一个仓库镜像服务器(myrepo),最初是为了镜像而创建的 与远程同步(repoA)。也就是说,我使用类似以下的内容来创建它。
cd myrepo
repo init -u git://repoA-server/manifest.git --mirror
repo sync
...然后我修改了清单文件的获取行以使用 myrepo 服务器 所以用户可以从 myrepo 镜像克隆
所以现在 repoA 已经消失并且不再存在。它已被替换为新的 repoB 服务器位于不同的 URL,它修改了一些分支并使用 这些分支的新清单文件。
如何将我的 myrepo 镜像与这个新的 repoB 重新同步?我不想被吹走 我的 myrepo 并创建一个新镜像。我想保留它的历史,只是 更新一些分支现在从 repoB 进行跟踪,并使用新的清单 文件(我将再次修改该文件以从 myrepo 获取项目)。
我不知道该怎么做?我想知道我是否可以简单地做一些 更改 myrepo,然后运行“reposync”以使其与新镜像同步 (即为更新分支进行获取/合并)?或者我必须克隆 myrepo 那么 做一些事情,比如添加 repoB 作为远程,创建跟踪分支,自己获取/合并, 并尝试将其推送到 myrepo?
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
...then I modified manifest file's fetch line to use myrepo server
so users can clone from myrepo mirror
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.
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).
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
继续更改配置文件中的网址/路径:
这将是最快的方法。尽管您可以使用命令来处理每个分支设置。
另请注意,如果它们同步,则重新克隆不会丢失任何历史记录。你会失去你的 reflog 和 rr-cache 等。
希望这有帮助。
亚当
go ahead and change the urls/paths in the config file:
That would be the fastest way. Although you could address each branch setup with commands.
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.
hope this helps.
Adam