【问题标题】:Setup local git server sync with remote设置本地 git 服务器与远程同步
【发布时间】:2019-07-29 18:43:45
【问题描述】:

我需要一个本地 git 服务器(裸机),它可以自动与目标遥控器同步。 喜欢:

(clone1) --|                                   |-- (remote1.git)

..       --|                                   |-- ...

(cloneN) --|       <==> (local.git) <==>       |-- (remoteM.git)

【问题讨论】:

    标签: git github clone git-clone


    【解决方案1】:

    你不能那样做。如果要从远程存储库中提取更改,则必须发出 git pull (origin) 命令: - https://git-scm.com/docs/git-pull - https://www.quora.com/What-are-the-differences-between-git-pull-git-pull-origin-master-and-git-pull-origin-master

    如果要将本地分支推送到远程仓库,则必须使用 git push: - https://www.edureka.co/community/33214/git-push-vs-git-push-origin - https://git-scm.com/docs/git-push

    您可以指定要与哪个遥控器同步。默认是原点。

    分支通常不会自行推动/拉动,因为有时您需要解决冲突

    【讨论】:

      【解决方案2】:

      Git 并非基于每隔一段时间拉取内容。
      一种解决方法是添加一个计划作业(在 cloneX 上)以每隔几分钟获取/拉取一次

      如果您使用的是 Unix,另一种选择是使用 https://myrepos.branchable.com 更新您的所有存储库,再次使用计划任务或作业。

      基本上,你需要自己做拉,因为 git 不是这样工作的。

      其他选项:

      阅读这篇优秀的博文:

      https://moox.io/blog/keep-in-sync-git-repos-on-github-gitlab-bitbucket/

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2018-11-30
        • 1970-01-01
        • 2023-03-19
        • 2020-08-27
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多