!镜像git存储库后出现[远程拒绝]错误 [英] ! [remote rejected] errors after mirroring a git repository

查看:1008
本文介绍了!镜像git存储库后出现[远程拒绝]错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在关注此文档: https://help.github.com/articles/duplicating-a-repository/

I'm following this documentation: https://help.github.com/articles/duplicating-a-repository/

git clone --mirror https://github.com/exampleuser/repository-to-mirror.git

cd repository-to-mirror.git

git push --mirror https://github.com/exampleuser/mirrored

输出显示存储库已作为镜像推送,但由于某些原因,我也遇到了这些错误:

The output shows that the repository is pushed as a mirror, but for some reason I'm getting these errors as well:

 ! [remote rejected] refs/pull/1/head -> refs/pull/1/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/1/merge -> refs/pull/1/merge (deny updating a hidden ref)

这些错误是什么?我可以假定存储库已镜像吗?

What are these errors? Can I assume the repository was mirrored ?

推荐答案

此问题,发生在您镜像有拉请求的GitHub存储库时.

As mentioned in this issue, that happens when you mirror a GitHub repo which has pull requests made to it.

以' refs/pull '开头的引用是GitHub创建的合成只读引用-您无法更新(并因此清理")它们,因为它们反映的是实际上可能很好的分支来自其他存储库-向您提交了拉取请求的存储库.

The refs beginning 'refs/pull' are synthetic read-only refs created by GitHub - you can't update (and therefore 'clean') them, because they reflect branches that may well actually come from other repositories - ones that submitted pull-requests to you.

因此,当您推送所有真实引用时,提取请求不会得到更新

So, while you've pushed all your real refs, the pull requests don't get updated

您需要镜像GitHub存储库 而没有

You would need to mirror a GitHub repo without their pull requests.

只需用两个更具体的规范替换上面的全部引用refspec,以仅包括所有heads和tag,但不包括pulls,并且所有远程pull ref将不再使其进入裸露的镜像:

Simply replace the catch-all refspec above with two more specific specs to just include all heads and tags, but not the pulls, and all the remote pull refs will no longer make it into your bare mirror:

fetch = +refs/heads/*:refs/heads/*
fetch = +refs/tags/*:refs/tags/*
fetch = +refs/change/*:refs/change/*

这篇关于!镜像git存储库后出现[远程拒绝]错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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