![如何使重复的存储库与 github 保持同步?](https://linux22.com/image/775639/%E5%A6%82%E4%BD%95%E4%BD%BF%E9%87%8D%E5%A4%8D%E7%9A%84%E5%AD%98%E5%82%A8%E5%BA%93%E4%B8%8E%20github%20%E4%BF%9D%E6%8C%81%E5%90%8C%E6%AD%A5%EF%BC%9F.png)
我已在 clone 中使用 github duplicate 选项和 --bare 并将其上传到 github.com 中的其他帐户
用法如下关联
就像将项目移交给另一个团队的过程一样。
但是原始存储库中最近发生了更改,如何同步所有分支中的这些更改。
答案1
一种选择是克隆为裸存储库,每当有更改时就从原始存储库中获取更改。
git clone --mirror https://primary_repo_url/primary_repo.git
git fetch origin
然后,将另一个新的 repo 添加为另一个远程,并在有需要同步的更改时将其推送到该 repo。
cd primary_repo.git
git remote add --mirror=fetch secondary https://secondary_repo_url/secondary_repo.git
git push secondary --all
如需了解更多详细信息和其他选项,我遵循了此关联