On-premise Gitlab to GitHub Mirroring

Md RaselMd Rasel
1 min read

The article is to create a mirror between gitlab and github. You can create mirror on github from your on-premise gitlab repo when a push events is happen. Let’s check the step-by-step solution.

  1. Create a GitHub repository as per your gitlab repo name or any.

    Go to your GitHub Settings → Developer Settings → GitHub Apps → Personal Access Token → Token Classic → Generate new

    Preserve the access token on a text editor or on a file; you will need this token for further use.

  2. Now Go to your Gitlab project repo, which you want to mirror on Gitlab. Open the repo and go to settings → Repository → Mirror repositories

    Put your Git repository url and username with the token on GIt repository URL like below

     https://<GitHub_username>:<GitHub_token>@github.com/MdRasel0/hello-world.git
    

    Choose the Mirror Direction Push and Put Your Access Token on the password field of Gitlab mirror.

    For testing whether the mirror is working or not, just click the below arrowed button.

    If all goes okay,, you will get your full Gitlab repo on GitHub with all the Branches.

That’s all you have to do to clone or mirror your Gitlab repo to GitHub repo.

1
Subscribe to my newsletter

Read articles from Md Rasel directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Md Rasel
Md Rasel

I’m Md. Rasel, a DevOps Lead at Synesis IT PLC with over a decade of experience in DevOps, Cloud Infrastructure, and Virtualization. My work blends automation, scalability, and reliability to help organizations build resilient, high-performing systems. I specialize in Kubernetes, Docker, Terraform, Jenkins, AWS, OCI, and Proxmox VE, along with CI/CD pipeline design, cloud-native application deployment, and infrastructure automation. My experience spans managing multi-tier applications, orchestrating containerized workloads, implementing secure DevSecOps practices, and optimizing cloud resources for cost and performance. Beyond hands-on engineering, I’m passionate about mentoring and training, having conducted technical workshops on topics like Kubernetes, network automation, monitoring, and cloud strategies at universities and industry events. When I’m not solving infrastructure challenges, I share insights on DevOps best practices, automation strategies, cloud-native technologies, and real-world troubleshooting—making complex tech approachable and actionable. Specialties: CI/CD Pipelines (Jenkins, GitLab CI) Kubernetes & Container Orchestration Infrastructure as Code (Terraform, Ansible) Cloud Platforms (AWS, Oracle Cloud, Azure) Monitoring & Observability (Prometheus, Grafana, ELK, Zabbix) DevSecOps & Security Automation 💡 Let’s connect—I’m always open to discussions about scalable architectures, DevOps automation, and cloud-native innovations.