Переезжаете с GitLab на GitHub? Полное руководство по миграции проектов!
Зачем мигрировать?
GitLab отличен for:
- Встроенный мощный CI/CD
- Self-hosted решения
- DevOps инструменты
GitHub лучше для:
- Портфолио (больше видимость)
- Open Source сообщество
- GitHub Actions
- Интеграции
Способ 1: Импорт через GitHub (САМЫЙ ПРОСТОЙ)
Шаги:
- Идите на github.com/new/import
- Вставьте GitLab URL:
https://gitlab.com/username/project - Если приватный → введите GitLab Personal Access Token:
- GitLab → Settings → Access Tokens
- Создайте token со scoperead_repository - Выберите имя репозитория на GitHub
- Public/Private
- Begin import
✅ GitHub автоматически перенесёт всё!
Способ 2: Git mirror (полный контроль)
Команды:
# 1. Клонируйте с GitLab (bare mode)
git clone --bare https://gitlab.com/username/project.git
# 2. Перейдите в папку
cd project.git
# 3. Создайте репозиторий на GitHub.com
# 4. Push зеркало
git push --mirror https://github.com/username/project.git
# 5. Cleanup
cd ..
rm -rf project.git
Всё! Код с полной историей на GitHub!
Способ 3: Через GitHub Desktop
- Clone GitLab репозиторий:
- File → Clone Repository → URL
- Вставьте GitLab HTTPS URL - После клонирования: Publish repository
- Готово!
Что переносится автоматически?
✅ Переносится
- Весь код
- История коммитов
- Все ветки
- Теги
- Contributors (авторы)
❌ НЕ переносится
- Issues
- Merge Requests (→ Pull Requests)
- CI/CD Pipelines
- Wiki
- Milestones
- Labels
Пост-миграция: адаптация
1. GitLab CI → GitHub Actions
Было (.gitlab-ci.yml):
test:
script:
- npm install
- npm test
Стало (.github/workflows/ci.yml):
name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm install
- run: npm test
2. Миграция Issues (если нужно)
Используйте инструмент: github.com/piceaTech/node-gitlab-2-github
npm install -g github-cli gitlab-2-github
g2g migrate \
--gitlabUrl https://gitlab.com \
--gitlabToken YOUR_GITLAB_TOKEN \
--githubToken YOUR_GITHUB_TOKEN \
--gitlabProjectId 12345 \
--githubOwner username \
--githubRepo project
3. Обновите README бейджи
Было (GitLab):
[]
Стало (GitHub):


Multiple проектов: массовая миграция
Скрипт для переноса нескольких проектов:
#!/bin/bash
GITLAB_URL="https://gitlab.com"
GITHUB_URL="https://github.com"
# Ваши репозитории
declare -a repos=(
"project1"
"project2"
"project3"
)
for repo in "${repos[@]}"; do
echo "Migrating $repo..."
git clone --bare $GITLAB_URL/username/$repo.git
cd $repo.git
git push --mirror $GITHUB_URL/username/$repo.git
cd ..
rm -rf $repo.git
echo "✅ $repo done!"
done
Командная миграция
Уведите команду:
## 📣 Мы переезжаем на GitHub!
**Старый (GitLab):**
https://gitlab.com/team/project
**Новый (GitHub):**
https://github.com/team/project
**Инструкции для команды:**
### Если уже есть клон:
\`\`\`bash
cd project
git remote set-url origin https://github.com/team/project.git
git fetch
\`\`\`
### Новички:
\`\`\`bash
git clone https://github.com/team/project.git
\`\`\`
**Дедлайн:** 15 апреля 2026
После этого GitLab repo будет read-only.
Сохранение истории GitLab
Если хотите сохранить Issues/MRs:
1. Экспорт проекта GitLab
- GitLab → Settings → General
- Advanced → Export project
- Скачайте архив (.tar.gz)
Храните как backup!
2. Сделайте GitLab read-only
- Settings → General → Permissions
- Project visibility → Private
- ✅ Disable forking
- ✅ Disable merge requests
- README — добавьте баннер:
## ⚠️ This project moved to GitHub
**New location:**
https://github.com/username/project
Сравнение CI/CD
| Feature | GitLab CI | GitHub Actions |
|---|---|---|
| Конфиг файл | .gitlab-ci.yml |
.github/workflows/*.yml |
| Runners | Shared/Own | GitHub hosted/Self-hosted |
| Минут (Free) | 400/month | 2000/month |
| Артефакты | 1GB | 500MB |
| Docker support | ✅ Отлично | ✅ Отлично |
| Сложность | Проще | Чуть сложнее |
Частые проблемы
Protected branches
GitLab → Settings → Repository → Protected Branches
Перенести в:
GitHub → Settings → Branches → Branch protection rules
LFS (Large File Storage)
Если используете Git LFS:
# Клонировать с LFS
git lfs clone --bare https://gitlab.com/user/repo.git
# Push с LFS
cd repo.git
git lfs push --all https://github.com/user/repo.git
Different authentication
GitLab может использовать Deploy Keys, GitHub — Deploy Keys или Personal Access Tokens.
Обновите в:
- CI/CD secrets
- Deployment scripts
- Webhooks
Почему GitHub?
Для разработчиков:
- ✅ Портфолио виднее
- ✅ Больше job opportunities
- ✅ Проще для начинающих
- ✅ GitHub Copilot
- ✅ Codespaces (cloud IDE)
Для компаний:
- ✅ GitHub Advanced Security
- ✅ Dependabot (автоматические security updates)
- ✅ GitHub Sponsors (монетизация open source)
Почему GitLab лучше:
- ✅ Мощнее CI/CD из коробки
- ✅ Бесплатнее для больших команд
- ✅ Self-hosted опция
- ✅ Built-in container registry
Обратная миграция
Передумали? Можно вернуться:
git clone --bare https://github.com/user/repo.git
cd repo.git
git push --mirror https://gitlab.com/user/repo.git
Checklist миграции
- [ ] Экспортировали Issues/MR (если нужно)
- [ ] Создали репозиторий на GitHub
- [ ] Перенесли код (
git push --mirror) - [ ] Настроили GitHub Actions (заменили
.gitlab-ci.yml) - [ ] Обновили README (badges, links)
- [ ] Настроили branch protection
- [ ] Обновитеили CI/CD secrets
- [ ] Уведомили команду
- [ ] Обновили documentation
- [ ] Тестировали CI/CD pipelines
- [ ] Сделали GitLab repo read-only
Удачной миграции! Добро пожаловать в GitHub! 🎉
💬 Comments (0)
No comments yet
Be the first to share your opinion about this article!