Skip to content

Instantly share code, notes, and snippets.

@drupchen
Forked from mariozig/migrate_repo.sh
Last active June 15, 2017 19:59
Show Gist options
  • Save drupchen/3b307fb3236a66b89ef1f6882b59f9a5 to your computer and use it in GitHub Desktop.
Save drupchen/3b307fb3236a66b89ef1f6882b59f9a5 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 [email protected]: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 [email protected]:mario/my-repo.git
# Set push URL to the mirror location
$ git remote set-url --push origin [email protected]:mario/my-repo.git
# locally save the credentials for this repo
$ git config credential.helper store
$ git push http://example.com/repo.git
Username: <type your username>
Password: <type your password>
# 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