Last active
September 16, 2024 18:48
-
Star
(227)
You must be signed in to star a gist -
Fork
(64)
You must be signed in to fork a gist
-
-
Save mariozig/bd3bb50593e6d911946b 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/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
# To periodically update the repo on GitHub with what you have in GitLab | |
git fetch -p origin | |
git push --no-verify --mirror |
Anyone finding this in 2020+, there is a very convenient import method from Gitlab now as well:
Click [+] in the Gitlab header > "New project" > Tab "Import project" > Select "Gitlab"
After authorization on GitHub you'll be taken to https://gitlab.com/import/github/status for easy import management.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, this works perfect!