如何为外部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的方式来做吗,比如"Mirrorred from“出现在存储库的名称下面?
发布于 2012-07-10 19:32:15
基于与GitHub的支持团队的通信,我发现GitHub目前没有为用户提供以这种方式镜像存储库的直接机制。
但是,可以要求GitHub为作为组织一部分的存储库安装此服务。然后,GitHub将现有的存储库配置为这样一个镜像,并以一个间隔从它中提取,这个间隔是它们拥有的整体镜像数量的函数。
编辑:正如斯图尔特指出的,GitHub不再接受用于镜像任意存储库的请求。剩下的唯一选项是我在问题中发布的解决方案,即创建一个post接收钩子来自动推送到您的GitHub存储库。
发布于 2014-08-16 12:38:47
从https://github.com/mirrors当前的内容来看,GitHub似乎不再做“官方镜像”了,因为今天大多数希望在GitHub上镜像其代码的项目只是使其成为一个组织,比如Git本身。
还有一个特性请求位于:https://github.com/isaacs/github/issues/415
发布于 2016-05-29 15:48:57
根据进口Git
为了演示的目的,我们将使用:
命令行:
# Makes a bare clone of the external repository in a local directory
$ git clone --bare https://githost.org/extuser/repo.git
# Pushes the mirror to the new GitHub repository
$ cd *repo.git*
$ git push --mirror https://github.com/ghuser/repo.git
# Remove the temporary local repository.
$ cd ..
$ rm -rf repo.githttps://stackoverflow.com/questions/11370239
复制相似问题