Package: gitlab-mirror-maker
GitLab Mirror MakerGitLab Mirror Maker is a small tool written in Python that automatically mirrors your public repositories from GitLab to GitHub.Why?Maybe you like GitLab better but the current market favors developers with a strong GitHub presence?Maybe as a form of backup?Or maybe you have other reasons... :wink:InstallationInstall with pip or pipx:pip install gitlab-mirror-makerThere's also a Docker image available:docker run registry.gitlab.com/grdl/gitlab-mirror-makerUsageRun:gitlab-mirror-maker --github-token xxx --gitlab-token xxxSeeAuthenticationbelow on how to get the authentication tokens.Environment variablesInstead of using cli flags you can provide configuration via environment variables with theMIRRORMAKER_prefix:export MIRRORMAKER_GITHUB_TOKEN xxx
export MIRRORMAKER_GITLAB_TOKEN xxx

gitlab-mirror-makerDry runRun with--dry-runflag to only print the summary and don't make any changes.Full synopsisUsage: gitlab-mirror-maker [OPTIONS]

Options:
  --version                 Show the version and exit.
  --github-token TEXT       GitHub authentication token  [required]
  --gitlab-token TEXT       GitLab authentication token  [required]
  --github-user TEXT        GitHub username. If not provided, your GitLab
                            username will be used by default.

  --dry-run / --no-dry-run  If enabled, a summary will be printed and no
                            mirrors will be created.

  --help                    Show this message and exit.How it works?GitLab Mirror Maker uses theremote mirrors APIto createpush mirrorsof your GitLab repositories.For each public repository in your GitLab account a new GitHub repository is created using the same name and description. It also adds a[mirror]suffix at the end of the description and sets the website URL the original GitLab repo. Seethe mirror of this repoas an example.Once the mirror is created it automatically updates the target GitHub repository every time changes are pushed to the original GitLab repo.What is mirrored?Only public repositories are mirrored to avoid publishing something private.Only the commits, branches and tags are mirrored. No other repository data such as issues, pull requests, comments, wikis etc. are mirrored.AuthenticationGitLab Mirror Maker needs authentication tokens for both GitLab and GitHub to be able to create mirrors.How to get the GitLab token?Click on your GitLab user -> Settings -> Access TokensPick a name for your token and choose theapiscopeClickCreate personal access tokenand save it somewhere secureDo not share it! It grants full access to your account!Here's more information aboutGitLab personal tokens.How to get the GitHub token?Click on your GitHub user -> Settings -> Developer settings -> Personal access tokens -> Generate new tokenPick a name for your token and choose thepublic_reposcopeClickGenerate tokenand save it somewhere secureHere's more information aboutGitHub personal tokens.Automate with GitLab CIInstead of running the tool manually you may want to schedule it to run periodically with GitLab CI to make sure that any new repositories are automatically mirrored.Here's a.gitlab-ci.ymlsnippet you can use:job:image:python:3.8-alpinescript:-pip install gitlab-mirror-maker-gitlab-mirror-makeronly:-schedulesHere's more info about creatingscheduled pipelines with GitLab CI.