Gitlab - 自动同步/复制本地服务器 from/to 云服务器
Gitlab - AutoSync / Replicate Local Server from/to Cloud Server
我有 2 个 Gitlab 服务器:
服务器 A 在云端运行并可从 https://git.example.com
访问
和
服务器 B 在本地网络上运行,只能通过本地计算机通过 IP 地址或在本地重定向的虚假域访问 http://local.git(DNS 欺骗)
如何让 git 服务器 A & B mirrored/synced/replicated where:
- Server B would automatically push any local work/changes to server A
After that (or before)
- Server B will check server A for any differences in any repo and make sure both are 100% synced - in another meaning, server B would pull the changes from server A because some people might push changes directly to server A from outside this local network.
我认为优先级不重要,因为最终两台服务器将 100% 相同 - 抱歉,我不是开发人员(或经常使用 git),但更像是 IT 人员.
最稳定的解决方案是在存储库级别镜像您的服务器。
GitLab 有一个内部机制可以为您执行此操作(请参阅:https://gitlab.com/help/workflow/repository_mirroring)。
另一种方法(因为您无法访问托管的 GitLab 实例上的文件系统)是创建一个脚本,使用 git push --mirror ..
.[=12 迭代地 "mirror" 您的存储库=]
我有 2 个 Gitlab 服务器:
服务器 A 在云端运行并可从 https://git.example.com
访问和
服务器 B 在本地网络上运行,只能通过本地计算机通过 IP 地址或在本地重定向的虚假域访问 http://local.git(DNS 欺骗)
如何让 git 服务器 A & B mirrored/synced/replicated where:
- Server B would automatically push any local work/changes to server A
After that (or before)
- Server B will check server A for any differences in any repo and make sure both are 100% synced - in another meaning, server B would pull the changes from server A because some people might push changes directly to server A from outside this local network.
我认为优先级不重要,因为最终两台服务器将 100% 相同 - 抱歉,我不是开发人员(或经常使用 git),但更像是 IT 人员.
最稳定的解决方案是在存储库级别镜像您的服务器。
GitLab 有一个内部机制可以为您执行此操作(请参阅:https://gitlab.com/help/workflow/repository_mirroring)。
另一种方法(因为您无法访问托管的 GitLab 实例上的文件系统)是创建一个脚本,使用 git push --mirror ..
.[=12 迭代地 "mirror" 您的存储库=]