GitLab - aetas-github-training/Support GitHub Wiki

Instructions to Migrate GitLab repo to GHE

This method will migrate and preserve all history including commits, branches, tags…

Assumptions

  • The GitLab repo exists in GHE (but empty, of course)
  • User has a GHE account with access to GHE and repos

Prep

  • Backup local GitLab repo (and rename that folder "*-gitlab")

Setup GitLab/GHE link

  1. Open Git Bash in the parent folder of GitLab repo
  • E.G.: if GitLab repo is in “c:/code/bcps”
  • Navigate to “c:/code” in Git Bash
  1. Create the link to GitLab repo by executing:

    git clone --mirror [email protected]:did-it/cf_bcps.git
    

    This will create “c:/code/cf_bcps” with peculiar files

  2. Create and populate GHE as follows:

    cd cf_bcps.git
    git push --no-verify --mirror [email protected]:USCIS/DIDIT-CF-HQK_BCPS.git
    
    • Verify that the repo has been populated in GHE
    • After verification, this folder can be removed now or in the future

Setup local GHE repo

  1. Bring down GHE repo (Dev and TEST) that was just created by:

    git -c http.sslVerify=false clone [email protected]:USCIS/DIDIT-CF-HQK_BCPS.git
    
  2. Rename directory as needed

  • E.G.., bcps

Get to work!

  • Subsequent updates to this repo is now all pushed to GHE repo and NOT GitLab repo