Mirroring GitLab to GitHub: A Step-by-Step Guide with Public Key Authentication

This page summarizes the projects mentioned and recommended in the original post on dev.to

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • repo

  • #!/bin/bash # Define an array that maps GitLab and GitHub repository URLs declare -A repo_map=( ["https://gitlab.com/username/repo.git"]="https://github.com/username/repo.git" ["https://gitlab.com/username/other-repo.git"]="https://github.com/username/other-repo.git" ) # Loop through the array and mirror each GitLab repository to its corresponding GitHub repository for gitlab_url in "${!repo_map[@]}"; do github_url="${repo_map[$gitlab_url]}" repo_name="$(basename "$gitlab_url" .git)" # Clone the GitLab repository git clone --mirror "$gitlab_url" # Change to the local repository directory cd "$repo_name.git" # Add the GitHub repository as a remote git remote add github "$github_url" # Push all branches and tags to the GitHub repository git push --mirror github # Remove the local repository directory cd .. rm -rf "$repo_name.git" done

  • repo

  • #!/bin/bash # Define an array that maps GitLab and GitHub repository URLs declare -A repo_map=( ["https://gitlab.com/username/repo.git"]="https://github.com/username/repo.git" ["https://gitlab.com/username/other-repo.git"]="https://github.com/username/other-repo.git" ) # Loop through the array and mirror each GitLab repository to its corresponding GitHub repository for gitlab_url in "${!repo_map[@]}"; do github_url="${repo_map[$gitlab_url]}" repo_name="$(basename "$gitlab_url" .git)" # Clone the GitLab repository git clone --mirror "$gitlab_url" # Change to the local repository directory cd "$repo_name.git" # Add the GitHub repository as a remote git remote add github "$github_url" # Push all branches and tags to the GitHub repository git push --mirror github # Remove the local repository directory cd .. rm -rf "$repo_name.git" done

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • #!/bin/bash # Define an array that maps GitLab and GitHub repository URLs declare -A repo_map=( ["https://gitlab.com/username/repo.git"]="https://github.com/username/repo.git" ["https://gitlab.com/username/other-repo.git"]="https://github.com/username/other-repo.git" ) # Loop through the array and mirror each GitLab repository to its corresponding GitHub repository for gitlab_url in "${!repo_map[@]}"; do github_url="${repo_map[$gitlab_url]}" repo_name="$(basename "$gitlab_url" .git)" # Clone the GitLab repository git clone --mirror "$gitlab_url" # Change to the local repository directory cd "$repo_name.git" # Add the GitHub repository as a remote git remote add github "$github_url" # Push all branches and tags to the GitHub repository git push --mirror github # Remove the local repository directory cd .. rm -rf "$repo_name.git" done

  • other-repo

  • #!/bin/bash # Define an array that maps GitLab and GitHub repository URLs declare -A repo_map=( ["https://gitlab.com/username/repo.git"]="https://github.com/username/repo.git" ["https://gitlab.com/username/other-repo.git"]="https://github.com/username/other-repo.git" ) # Loop through the array and mirror each GitLab repository to its corresponding GitHub repository for gitlab_url in "${!repo_map[@]}"; do github_url="${repo_map[$gitlab_url]}" repo_name="$(basename "$gitlab_url" .git)" # Clone the GitLab repository git clone --mirror "$gitlab_url" # Change to the local repository directory cd "$repo_name.git" # Add the GitHub repository as a remote git remote add github "$github_url" # Push all branches and tags to the GitHub repository git push --mirror github # Remove the local repository directory cd .. rm -rf "$repo_name.git" done

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project