开发者

how to sync a repo mirror to a new upstream repo

开发者 https://www.devze.com 2023-04-01 09:02 出处:网络
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.

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?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号