Use GitHub as a mirror for your GitLab projects
Aug 20, 2016
1 minute read

As GitHub is more popular than GitLab, I wanted some of my personal projects also get hosted on GitHub. Here is a three step manual to mirror a GitLab Repository.

1. Create Repository and SSH key

First create a new repository where the mirror is getting to be stored. I have a project named JPAL on Gitlab ( so i created a GitHub repository with the same name (

Fetch your ssh key with cat ~/.ssh/ and save it in GitHub under Settings -> SSH … -> New SSH key.

2. Edit config

Add following host data in your .git/config (replace with your repository).

[remote "github"]
  url =
  fetch = +refs/*:refs/*
  mirror = true


Finally you can push to your mirror:

git push --mirror github

PS: Somehow you can write a push hook which updates your mirror automatically. If I find out how, I will post it here!