我有两个git仓库在两个单独的gitlab部署上使用相同的代码。这不是gitlab EE,所以我没有提供给我的镜像功能。如何使两个git仓库相同
在开始时,我确保每次提交都被推送到两个回购站,但随着时间的推移,它失去了手,我可以公平地对待这种做法。
目前,我会强制要使repo1
与repo2
相同。但是,当我这样做时,我似乎陷入了一个圈子。
这是我做的:
$ git pull repo1 master
...there are conflicts.
...I resolve them, add the file, then do git rebase --continue
$ git push repo1 master --now this works
$ git pull repo2 master
...there are conflicts.
...I resolve them, add the file, then do git rebase --continue
$ git push repo2 master
以上后,我会想象一切正常。但是现在当我做git pull repo1 master
时,我必须再次执行上述步骤。
问题
有没有办法强行让repo1
一样repo2
比gitlab删除repo1并启动了其他?
此外,前进什么是保持两个回购站同步的最佳方式?