25

I apologise if this question is a bit off-topic, but I would like to know how one goes about setting up a 'mirror' repository on GitHub, as is seen at https://github.com/mirrors.

Also, I am running Windows.

shea
  • 1,129
  • 2
  • 21
  • 38
  • 14
    Shouldn't this have been migrated to SuperUser, instead of closed? –  Feb 02 '19 at 14:57

2 Answers2

12

That looks just like a regular user account, except maintained by Github staff. If you think they would be interested in hosting your project on that page, you can email them, as the page states: support@github.com

However, unless you're Linus Torvalds or Larry Wall, they're probably not going to jump at the chance. You have to set up your own account, and then just create a public repository---which is free--and voilà, there's your mirror.

Locally, if you already have a different remote repository for that project, you just set your Github account as a second remote to which you can either push whenever you push to your primary remote, or on special occasions.

If you want to create a repo that displays the "mirrored from" line that you see on their mirrors page, according to this answer, you have to contact Github support: Creating an official github mirror

Community
  • 1
  • 1
Dmitri
  • 2,658
  • 2
  • 25
  • 41
  • If you notice, there is a list of repo types up in the top-right corner of the profile. All of these repos are of the 'Mirror' type, and appear to be a way of viewing off-site repos on GitHub. I'm wondering how to set one of these up. – shea Oct 19 '12 at 05:34
  • @bungeshea Gothcha! Amazing what you don't see on a page that you look at every day. I found the info you are looking for in another question, and edited my answer to reflect it. Sorry it's not better news ... – Dmitri Oct 19 '12 at 05:47
  • So you have to contact them for every "mirror" you want to do? Seems like Apache has their own mirrors on their organisation: https://github.com/apache/ant – CMCDragonkai Mar 29 '14 at 12:32
  • @CMCDragonkai : I am sure Github and the Apache Foundation can communicate. "Mirrors" is like a Github user: if you want on his page, you have to ask. – Dmitri Apr 05 '14 at 19:03
1

I doubt GitHub has a mechanism to automatically mirror a repo. That would go against them wanting you to have the repo in GitHub in the first place.

If you are wanting to mirror a public repo, chances are that someone is already doing it. Then you can just use that (or fork it). Otherwise, you'll need to have some server or cronjob or something that does it for you. Or if the repo you are mirroring supports post-commit hooks, setup a hook to push to GitHub.

asmeurer
  • 86,894
  • 26
  • 169
  • 240