Move GitLab Repository to GitHub #171534
Replies: 4 comments
-
| ✅ Pre-Requisites A GitHub account and a new empty repo (do not initialize it with README or other files). Git installed locally. Git LFS installed and initialized (git lfs install). Sufficient permissions on the GitLab repo to clone it with full history. Enough storage/quota on GitHub (GitHub has a 2 GB soft limit per repo, and LFS storage is separate). 🛠️ 1. Clone the GitLab Repository (with all branches and tags) git clone --mirror https://gitlab.com/your-namespace/your-repo.git --mirror clones all branches, tags, and refs (including remotes). This also includes the LFS pointers, but the actual LFS files may not be downloaded yet. 🧹 2. Clean Up LFS (Optional, if needed) If you're migrating to GitHub LFS and GitLab has large files not tracked by LFS, you may want to migrate those into LFS before pushing to GitHub. Use git lfs migrate: git lfs migrate import --everything --include=".psd,.zip,.tar,.mp4" 
 🏷️ 3. Create GitHub Repo and Push Everything Create an empty GitHub repo: Then push everything to GitHub: git remote set-url origin https://github.com/your-username/your-repo.git 
 📁 4. Set Up Git LFS on GitHub Ensure Git LFS is enabled on GitHub. This is automatic once you push LFS-tracked files. If you're not using Git LFS yet, you can initialize and track large files: git lfs install Then push: git push origin main 
 🔁 5. Migrate Merge Requests (Pull Requests) Git does not support migrating pull/merge requests automatically. Options: Manual Recreation: Recreate key pull requests manually in GitHub. Use GitHub API / Tools: Tools like gitlab-to-github or gitlab-migration can help move issues and PRs. GitHub’s Import Tool may help in some cases (though it doesn't support LFS or PRs). ✅ 6. Verify the Migration Check: All branches and tags are present. Commit history is intact. LFS files are accessible (no pointer files shown). Issues / PRs (if migrated). Webhooks, GitLab CI/CD -> GitHub Actions (if used). | 
Beta Was this translation helpful? Give feedback.
-
| Thanks for the detailed explanation. | 
Beta Was this translation helpful? Give feedback.
-
| Hi, You can try with https://github.com/new/import , if it doesnt work you can try this: You can migrate your GitLab repository to GitHub with full commit history, branches, and LFS files. Since your repo is large (11 GB) and has big files (>150 MB), using Git LFS is important. Here’s how you can do it: 1. Prepare GitHub repository
 2. Install Git LFS locallygit lfs installTrack large files that Git LFS should manage: git lfs track "*.zip"  # replace with your large file types
git add .gitattributes
git commit -m "Track large files with LFS"3. Clone your GitLab repositorygit clone --mirror https://gitlab.com/username/your-repo.git
cd your-repo.git
 4. Push to GitHubgit remote set-url origin https://github.com/username/your-repo.git
git push --mirrorThis will push all branches and tags to GitHub. 5. Push LFS filesAfter mirroring, push large files tracked by LFS: git lfs push --all origin6. Verify migration
 7. Optional: Use GitHub import toolGitHub also has an [import repository tool](https://github.com/new/import) that can import from GitLab, but for very large repos with LFS, the manual mirroring method is more reliable. I hope this helps (: | 
Beta Was this translation helpful? Give feedback.
-
| 🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as  2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the  Thank you for helping bring this Discussion to a resolution! 💬 | 
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Question
Body
Hi,
I have GitLab repository which consists more commits and pull requests. The total repo size is 11 GB.
It have some big files(> 150MB) also. It requires GIT LFS help also.
I need to move GitLab repository to GitHub. Can you suggest the steps which I need to do for move the repos with commit history and branches?
Beta Was this translation helpful? Give feedback.
All reactions