Skip to content

Instantly share code, notes, and snippets.

@zeroc0d3
Created July 30, 2020 02:01
Show Gist options
  • Select an option

  • Save zeroc0d3/6892a5abc0bd79f98d2f26475cc56965 to your computer and use it in GitHub Desktop.

Select an option

Save zeroc0d3/6892a5abc0bd79f98d2f26475cc56965 to your computer and use it in GitHub Desktop.
Mirroring Repository from GitHub to GitLab

Mirroring Repository from GitHub to GitLab

Step-by-Step

  • Open Terminal
  • Create new repository on gitlab cloud (as a target mirror)
  • Mirror clone your gitlab onpremise repository
    git clone --mirror [url_github_repo] [name_repo_mirror]
    
  • Go to cloned repository folder
    cd [name_repo_mirror]
    
  • Add new target origin
    git remote add new-origin [url_gitlab_repo]
    
  • Push new-origin as mirror origin in target repo (GitHub -> GitLab)
    git push new-origin --mirror
    

All done (your repository will be same as the old once -including branch, tags and commit messages-), happy mirroring!.

Proof-of-Concepts (PoC)

git clone --mirror git@github.com:zeroc0d3/cicd-laravel.git 
cd cicd-laravel.git
git remote add new-origin git@gitlab.com:zeroc0d3/cicd-laravel.git
git push new-origin --mirror
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment