A Python script to import repositories from GitLab to GitHub using manifest.xml file.
- Import multiple repositories from GitLab to GitHub
- Support for manifest.xml parsing
- Import to personal account or organization
- Optional prefix for repository names
- Custom GitLab base URL support
- Automatic repository creation on GitHub
- Mirror clone (all branches and tags)
- Python 3.6+
- Git
- requests library
pip install requestspython gitlab_to_github_importer.pySet GitHub token as environment variable:
export GITHUB_TOKEN="your_github_token_here"The script will prompt you for:
- GitHub Personal Access Token (if not set in environment)
- Path to manifest.xml file
- Target (Personal Account or Organization)
- Optional prefix for repository names
- GitLab base URL (default: https://gitlab.com)
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="origin" fetch="https://gitlab.com" />
<project path="project1" name="group/project1" remote="origin" revision="main" />
<project path="project2" name="group/project2" remote="origin" revision="master" />
</manifest>Your GitHub Personal Access Token needs the following scopes:
repo(full control of private repositories)admin:org(if importing to organization)
- Parses manifest.xml to extract repository information
- Creates repositories on GitHub (personal or organization)
- Clones repositories from GitLab using --mirror flag
- Pushes all branches and tags to GitHub
- Cleans up temporary files
============================================================
GitLab to GitHub Repository Importer
Support Import repositories via manifest.xml
============================================================
Enter path to manifest.xml (default: ./manifest.xml):
Select Import Target
1. Personal Account (User)
2. Organization
Select option (1 or 2): 1
Enter prefix for GitHub repo names (optional, e.g., 'pixel-'):
Enter GitLab base URL (default: https://gitlab.com):
Found 5 projects to import
Target: User 'username'
Projects to be imported:
1. group/project1 -> project1
2. group/project2 -> project2
Continue with import? (y/n): y
The script handles:
- Missing manifest files
- Repository creation failures
- Clone failures
- Push failures
- Network errors
- Rate limiting (2 second delay between imports)
- Existing repositories on GitHub will be skipped with a warning
- All branches and tags are imported
- Repository history is preserved
- Large repositories may take time to import