创建一个官方github镜像 [英] Creating an official github mirror

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

问题描述

如何为外部git存储库创建一个github镜像,使其显示为真实镜像,例如,如 https://github.com/mirrors



到目前为止,我使用以下方式设置了一个镜像:

  cd / path / to / bare / repository 
git remote add --mirror github git@github.com:user / repo.git

并配置post接收钩子来做一个 git push --quiet github 。然而,这种方式,github不承认镜像。



任何想法如何做到这一点的github方式,使得镜像自出现在repostiory名下? / p>

解决方案

基于与github支持团队的沟通,我发现github目前没有提供直接机制让用户以这种方式镜像存储库。

但是,可以要求github为作为组织一部分的存储库安装此服务。然后,Github将现有的存储库配置为这样一个镜像,并在一个间隔内从中拉出,这个时间间隔是它们所具有的全部镜像的数量的函数。

编辑:正如Stuart指出的那样,github不再接受镜像任意存储库的请求。剩下的唯一选择就是我在我的问题中发布的解决方案,即创建一个post-receive钩子来自动推送到你的github仓库。


How do I create a github mirror for an external git repository, such that it appears as "real mirror", e.g., as in https://github.com/mirrors?

So far, I set up a mirror using:

cd /path/to/bare/repository
git remote add --mirror github git@github.com:user/repo.git

and configure the post receive hook to do a git push --quiet github. This way, however, github does not recognize the mirror.

Any ideas how to do it the github way, such that "Mirrorred from" appears underneath the repostiory name?

解决方案

Based on communicating with github's support team, I found that github currently offers no direct mechanism for a user to mirror repositories in this fashion.

However, one can ask github to install this service for repositories which are part of an organization. Github then configures an existing repository as such a mirror and pulls from it in an interval that is a function of the number of overall mirrors they have.

EDIT: as Stuart points out, github no longer accepts requests for mirroring arbitrary repositories. The only remaining option is the solution I posted in my question, i.e., creating a post-receive hook to automatically push to your github repository.

这篇关于创建一个官方github镜像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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