Mirroring from Gitlab to Github

Ingwie Phoenix picture Ingwie Phoenix · May 15, 2015 · Viewed 14.7k times · Source

I have been using a private Gitlab instance to hold all my code. But since most of the staff that work with me now have a Github account, i would really like to get moving and mirror my Gitlab repo to Github.

My situation:

  • a server running Gitlab (Omnibus)
  • a Github account for which I'll create an organization for where me and my staff can be organized together.

I know that there is the --mirror switch in git, but I am not really sure how this is ment to work. Documentation I found online was very wonky... So it would be nice if someone could help me out. :)

Answer

knocte picture knocte · Jun 5, 2019

GitLab has now an option to do this from the UI, go to the Settings->Repository of your repo:

https://gitlab.com/yourUserNameInGitLab/yourRepoName/settings/repository

Then find the option "Mirror a repository" and click on expand. What you want to do is choose the "Push" mirror direction and fill this URL:

https://[email protected]/yourUserNameInGitHub/yourRepoName.git