gpt4 book ai didi

git - 自动镜像 GitHub 存储库

转载 作者:太空狗 更新时间:2023-10-29 12:47:39 27 4
gpt4 key购买 nike

我怀疑以前有人问过这个问题,尽管我能找到的都是相似但不同的问题,或者是相同的问题,但只有对我不起作用的解决方案。

GitHub 上有一个我无法控制的存储库,我想镜像它。对于镜像,我的意思是有一个自动更新的克隆。我希望这个镜像也能在 GitHub 上。最好任何解决方案都不会涉及我这边的太多配置或设置工作。但是,如果需要,我可以在某些 VPS 上使用 cron 运行脚本。

我可以完全通过 GitHub 创建这样的镜像吗?如果没有,是否准备好使用脚本来执行此操作?

最佳答案

有趣的问题,考虑到所有Eclipse repos镜像 on GitHub .

但是,如 recent (April 2013) article 所示来自 Wayne ,没有自动 GitHub 方式来镜像存储库。

As far as I know, GitHub provides no mechanism to schedule a regular pull (correct me if I’m wrong), which means that it would become our responsibility to push to the GitHub clone.

另见 bug 402183 .

因此,VPS 上的脚本(即设置的东西)仍然是实现这一点的最可靠方法。

在“HowTo mirror your git repository on Github”的基础上,您需要自己的本地克隆,以及一个脚本:

  • 定期从 GitHub 存储库中 pull
  • 推送到Github上的镜像

2015 年更新(2 年后):类似 beefsack/git-mirror 的工具(在 go 中)是:

designed to create and serve read-only mirrors of your Git repositories locally or wherever you choose.
A recent GitHub outage reinforces the fact that developers shouldn't be relying on a single remote for hosting code.

关于git - 自动镜像 GitHub 存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15871787/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com