自动镜像GitHub仓库 [英] Automatically mirroring a GitHub repo

查看:157
本文介绍了自动镜像GitHub仓库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怀疑这个问题以前曾被问到过,尽管我能找到的所有问题都是相似但不同的问题,或者只有解决方案不适用于我的解决方案才是相同的。



GitHub上有一个仓库,我无法控制并想要镜像。有了镜像,我的意思是有一个自动更新的克隆。我希望这个镜像也在GitHub上。优选地,任何解决方案都不涉及来自我方的很多配置或设置工作。但是,如果需要,我可以在某些VPS上使用cron运行脚本。



我可以纯粹通过GitHub创建这样一个镜像吗?如果没有,是否准备好使用脚本来做到这一点?

解决方案

有趣的问题,考虑到所有 Eclipse回购站在GitHub上镜像



但是,正如最近(2013年4月)文章来自 Wayne , re是没有自动GitHub的方式来镜像回购。


据我所知,GitHub没有提供任何机制来安排正常拉动(正确如果我错了),这意味着它将成为我们的责任推到GitHub克隆。


另见 bug 402183

因此,VPS上的脚本(即 you 设置)仍然是实现此目的的最可靠方法。



基于 How to mirror your git repository on Github ,您需要自己的本地克隆,并使用脚本:




  • 定期从GitHub仓库中提取

  • 推送到Github上的镜像
  • ul>

    2015年更新(2年后):像 beefsack / git-mirror (在)是: b
    $ b


    用于在您本地或您选择的任何位置创建和提供Git存储库的只读镜像。

    GitHub中断加强了这样一个事实,即开发人员不应该依赖单个远程服务器来托管代码。



    I suspect this question has been asked before, though all I can find are similar but distinct questions or the same one with only solutions that do not work for me.

    There is a repository on GitHub that I have no control over and would like to mirror. With mirror I mean have a clone that gets updated automatically. I want this mirror to also be on GitHub. Preferably any solution would not involve much configuration or setup work from my side. However if needed I can have a script run using a cron on some VPS.

    Can I create such a mirror purely via GitHub? If not, are there ready to use scripts to do this?

    解决方案

    Interesting question, considering all Eclipse repos are mirrored on GitHub.

    But, as illustrated by the recent (April 2013) article from Wayne, the re is no automatic GitHub way to mirror a repo.

    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.

    See also bug 402183.

    So a script on a VPS (ie, something you setup) remains the surest way to implement this.

    Building on "HowTo mirror your git repository on Github", you would need your own local clone, with a script which would:

    • regularly pull from the GitHub repo
    • push to the mirror on Github

    Update 2015 (2 years later): a tool like beefsack/git-mirror (in go) is:

    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.

    这篇关于自动镜像GitHub仓库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆