! [remote rejected] errors after mirroring a git repository

I'm following this documentation:

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 ?


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

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

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

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/*


 ? Trying to mirror Apple Watch screen for demo
 ? Publishing artifacts with sources on archiva
 ? How do i set Maven to retrieve dependencies first from my own remote repository (Archiva)?
 ? How to force authentication to Archiva internal repository?
 ? Issue pulling SNAPSHOT dependencies from Archiva snapshot repository
 ? Cannot download 3rd party maven artifacts via apache archiva
 ? Apache archiva not able to connect to central
 ? How to use Apache Archiva with Maven?
 ? How to reset Apache Archiva Password
 ? Linux Kiosk software?