我有兩個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並啓動了其他?
此外,前進什麼是保持兩個回購站同步的最佳方式?