how to sync a repo mirror to a new upstream repo

大城市里の小女人 提交于 2019-12-24 02:33:44

问题


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?


回答1:


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.

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



来源:https://stackoverflow.com/questions/7247881/how-to-sync-a-repo-mirror-to-a-new-upstream-repo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!