Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set up a mirror repo on GitHub [closed]

Tags:

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.

like image 410
shea Avatar asked Oct 19 '12 02:10

shea


2 Answers

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: [email protected]

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

like image 164
Dmitri Avatar answered Nov 23 '22 01:11

Dmitri


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.

like image 26
asmeurer Avatar answered Nov 23 '22 00:11

asmeurer