No project description provided
Project description
๐ gh2gl
โจ GitHub to GitLab Mirroring CLI โจ
Seamlessly mirror your GitHub repositories to GitLab with style and ease
๐ Features
- ๐ Secure Authentication - Store GitHub & GitLab tokens safely with keyring
- ๐ Bulk Mirroring - Mirror all your repositories at once
- ๐จ Beautiful UI - Rich terminal interface with progress bars and panels
- ๐ Private Repos - Full support for private repositories
- โก Smart Sync - Skip existing repos or force overwrite with
--force - ๐งน Clean Names - Automatic project name sanitization for GitLab compatibility
- ๐ Progress Tracking - Real-time statistics and detailed reporting
- ๐ Dry Run - Preview operations without making changes
- ๐ ๏ธ Self-Hosted - Works with custom GitLab instances
๐ฆ Installation
For Users
# Install with pipx (recommended)
pipx install gh2gl
# Or install with pip
pip install gh2gl
For Development
# Clone the repository
git clone https://github.com/viniciusccosta/gh2gl.git
cd gh2gl
# Install in development mode
pip install -e .
๐ Quick Start
1๏ธโฃ Setup Authentication
# Login to GitHub
gh2gl login github
# Login to GitLab
gh2gl login gitlab
2๏ธโฃ Test Connections
# Verify API connectivity
gh2gl test
3๏ธโฃ Mirror Repositories
# Preview what will be mirrored (dry run)
gh2gl mirror --dry-run
# Mirror all repositories
gh2gl mirror
# Force sync existing repositories
gh2gl mirror --force
๐ Commands
| Command | Description | Example |
|---|---|---|
status |
๐ Check credential configuration | gh2gl status |
test |
๐งช Test API connectivity | gh2gl test |
login github |
๐ Setup GitHub authentication | gh2gl login github |
login gitlab |
๐ Setup GitLab authentication | gh2gl login gitlab |
mirror |
๐ Mirror repositories | gh2gl mirror |
โ๏ธ Command Options
Mirror Command Flags
--dry-run๐ - Preview operations without making changes--skip-existingโญ๏ธ - Skip repositories that already exist on GitLab--force๐ช - Overwrite existing GitLab repositories
# Examples
gh2gl mirror --dry-run # Preview only
gh2gl mirror --skip-existing # Skip existing repos
gh2gl mirror --force # Force overwrite all
๐ง Configuration
GitHub Token Setup
- Go to GitHub Settings โ Developer settings โ Personal access tokens
- Create a token with
repoanduserpermissions - Run
gh2gl login githuband enter your token
GitLab Token Setup
- Go to GitLab User Settings โ Access Tokens
- Create a token with
api,read_repository, andwrite_repositoryscopes - Run
gh2gl login gitlaband enter your details
Custom GitLab Instance
# For self-hosted GitLab
gh2gl login gitlab
# Enter your custom GitLab URL when prompted
๐ธ Screenshots
Beautiful Status Display
โโ Credential Status โโ
โ โจ All credentials โ
โ configured! โ
โโโโโโโโโโโโโโโโโโโโโโโ
Rich Progress Tracking
๐ Mirroring GitHub โ GitLab
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ 100% 23/23 repos
โโ Summary โโ
โ โ
21 Created โ
โ โญ๏ธ 2 Skipped โ
โ โ 0 Errors โ
โโโโโโโโโโโโโโโโโโโโ
๐๏ธ How It Works
- ๐ Discovery - Fetches all your GitHub repositories (public + private)
- ๐งน Sanitization - Cleans repository names for GitLab compatibility
- ๐ Mirroring - Uses
git clone --mirrorfor complete repository copies - ๐ค Upload - Pushes to GitLab with proper authentication
- ๐ Reporting - Provides detailed success/error statistics
๐ก๏ธ Security
- ๐ Secure Storage - Tokens stored safely using system keyring
- ๐ซ No Plaintext - Credentials never stored in configuration files
- ๐ OAuth2 - Uses secure OAuth2 authentication for GitLab
- ๐ค User Scoped - Only accesses repositories you have permission to
๐ Troubleshooting
Common Issues
404 Errors
- Ensure your tokens have the correct permissions
- Verify GitLab URL is correct for self-hosted instances
Authentication Failed
- Re-run the login commands to refresh tokens
- Check token expiration dates
Repository Name Conflicts
- The tool automatically sanitizes names for GitLab compatibility
- Use
--forceto overwrite existing repositories
Debug Mode
# Run with verbose output
gh2gl mirror --dry-run # See what would happen first
๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
Made with โค๏ธ and โ
Happy mirroring! ๐
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gh2gl-0.1.0.tar.gz
(11.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
gh2gl-0.1.0-py3-none-any.whl
(11.9 kB
view details)
File details
Details for the file gh2gl-0.1.0.tar.gz.
File metadata
- Download URL: gh2gl-0.1.0.tar.gz
- Upload date:
- Size: 11.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.2 CPython/3.13.7 Darwin/24.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70de219b54c229b73e39bee7ae940ddd9cc24b75389e1a9829979414c9e71a1d
|
|
| MD5 |
7b931f8c937391b02c79684dfc86158b
|
|
| BLAKE2b-256 |
4ba3c5dce451668e3c4f72dd22bd247b2f91462eb1391d6e0ec49fe0b8995e89
|
File details
Details for the file gh2gl-0.1.0-py3-none-any.whl.
File metadata
- Download URL: gh2gl-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.2 CPython/3.13.7 Darwin/24.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d6e02631f69397594e595a5fb65b318cf3c1617f26945a4de96fecf74ff2552
|
|
| MD5 |
273ba61004ab9a17e2c87903e5aaac10
|
|
| BLAKE2b-256 |
916d3ded1cb890b6b9690aef0a50f18f94faec8f9b6732aff9f585ab66736a62
|