Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mihdan
Forked from mariozig/migrate_repo.sh
Created July 6, 2021 16:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mihdan/cc4d6c0dddbac0761a7eed1a3f9f71a6 to your computer and use it in GitHub Desktop.
Save mihdan/cc4d6c0dddbac0761a7eed1a3f9f71a6 to your computer and use it in GitHub Desktop.
Migrate repo from GitLab to GitHub Full blog post @ http://ruby.zigzo.com/2015/03/23/moving-from-gitlab-to-github/
# Assume we are in your home directory
cd ~/
# Clone the repo from GitLab using the `--mirror` option
$ git clone --mirror git@your-gitlab-site.com:mario/my-repo.git
# Change into newly created repo directory
$ cd ~/my-repo.git
# Push to GitHub using the `--mirror` option. The `--no-verify` option skips any hooks.
$ git push --no-verify --mirror git@github.com:mario/my-repo.git
# Set push URL to the mirror location
$ git remote set-url --push origin git@github.com:mario/my-repo.git
# To periodically update the repo on GitHub with what you have in GitLab
git fetch -p origin
git push --no-verify --mirror
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment