Migrating Your GitLab Repositories

Tags git gitlab

When migrating repositories from GitLab, they fall into two categories:

  1. Repositories created under a group space (e.g. https://git.dartmouth.edu/GROUP/repo)

  2. Repositories created under your personal space (e.g. https://git.dartmouth.edu/NETID/repo)

1. Migrating repositories from a group space

  • To migrate your repositories from GitLab to the Dartmouth GitHub organization, please create a service request. We will then invite you to the Dartmouth's GitHub organization and assist you with the migration process.

    Service Request Link

2. Migrating repositories from your personal space

  • If you only want to clone the repositories locally on your machine, you can ignore the next step in this guide
  • Create an account with an alternative Git service (e.g. github.com, gitlab.com, etc.)
  • Complete the following steps
    1. Clone the repository locally
    2. Create a new repository on the destination platform
    3. Update repository configuration
    4. Push to the new repository
    5. Verify migration and update places where you've been using this repository
  • Here are the example commands you can follow to accomplish these steps
# Clone the repository from GitLab
git clone <your-git-repo-uri>
cd your-repo

# Create the repository in the new location using the Service Website

# Set the new remote repository URL (if migrating to a new platform)
git remote rename origin old-origin
git remote add origin <your-new-git-remote-repo-uri>

# Push all branches to the new remote
git push --set-upstream origin --all

# Push all tags to the new remote
git push --set-upstream origin --tags

 

 

Print Article

Details

Article ID: 160509
Created
Fri 7/12/24 8:22 AM
Modified
Wed 9/18/24 9:34 AM