{"id":29089203,"url":"https://github.com/bocaletto-luca/gitlab-to-github-auto","last_synced_at":"2026-05-05T00:32:37.228Z","repository":{"id":301221410,"uuid":"1008557954","full_name":"bocaletto-luca/gitlab-to-github-auto","owner":"bocaletto-luca","description":"GitLab to GitHub Auto Update Author: Bocaletto Luca GitLab to GitHub Auto Update is a Python tool that automates the import and synchronization of all your GitLab projects into GitHub. It will:  Fetch every project you’re a member of on GitLab. Create a matching GitHub repo if it doesn’t already exist. Invoke GitHub’s “Import Repository” API to ...","archived":false,"fork":false,"pushed_at":"2025-06-25T18:29:40.000Z","size":22,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-25T19:31:11.298Z","etag":null,"topics":["admin","auto-import","auto-update","bocaletto-luca","console","github","gitlab","gitlab-to-github","gitlab-to-github-migration","linux","opensource","python","script","tool"],"latest_commit_sha":null,"homepage":"https://bocaletto-luca.github.io/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bocaletto-luca.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-25T18:20:54.000Z","updated_at":"2025-06-25T18:27:02.000Z","dependencies_parsed_at":"2025-06-25T19:42:25.206Z","dependency_job_id":null,"html_url":"https://github.com/bocaletto-luca/gitlab-to-github-auto","commit_stats":null,"previous_names":["bocaletto-luca/gitlab-to-github-auto"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/bocaletto-luca/gitlab-to-github-auto","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bocaletto-luca%2Fgitlab-to-github-auto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bocaletto-luca%2Fgitlab-to-github-auto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bocaletto-luca%2Fgitlab-to-github-auto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bocaletto-luca%2Fgitlab-to-github-auto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bocaletto-luca","download_url":"https://codeload.github.com/bocaletto-luca/gitlab-to-github-auto/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bocaletto-luca%2Fgitlab-to-github-auto/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262371661,"owners_count":23300591,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["admin","auto-import","auto-update","bocaletto-luca","console","github","gitlab","gitlab-to-github","gitlab-to-github-migration","linux","opensource","python","script","tool"],"created_at":"2025-06-28T04:01:25.369Z","updated_at":"2026-05-05T00:32:37.216Z","avatar_url":"https://github.com/bocaletto-luca.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitLab to GitHub Auto Update\n#### Author: Bocaletto Luca\n\n[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue?style=for-the-badge\u0026logo=gnu)](LICENSE) [![Language: Python](https://img.shields.io/badge/Language-Python-blue?style=for-the-badge\u0026logo=python)](https://www.python.org/) [![Linux-Compatible](https://img.shields.io/badge/Linux-Compatible-blue?style=for-the-badge\u0026logo=linux)](https://www.kernel.org/) [![Status: Complete](https://img.shields.io/badge/Status-Complete-brightgreen?style=for-the-badge)](https://github.com/bocaletto-luca/Directory-Monitor)\n\n**GitLab to GitHub Auto Update** is a Python tool that automates the import and synchronization of all your GitLab projects into GitHub. It will:\n\n1. Fetch every project you’re a member of on GitLab.  \n2. Create a matching GitHub repo if it doesn’t already exist.  \n3. Invoke GitHub’s “Import Repository” API to pull from GitLab (using your GitLab credentials for private repos).\n\nIdeal if you manage hundreds of repos and want a hands-free mirror on GitHub!\n\n---\n\n## Table of Contents\n\n- [Features](#features)  \n- [Requirements](#requirements)  \n- [Installation](#installation)  \n- [Configuration](#configuration)  \n- [Usage](#usage)  \n- [How It Works](#how-it-works)  \n- [Contributing](#contributing)  \n- [License](#license)  \n\n---\n\n## Features\n\n- **Bulk Sync:** Loops through all your GitLab projects in one go.  \n- **Auto-Create:** Creates GitHub repos on demand (public or private).  \n- **Seamless Imports:** Kicks off GitHub’s official Import API for mirroring.  \n- **Handles Privacy:** Passes your GitLab token when importing private repos.  \n\n---\n\n## Requirements\n\n- **Python 3.6+**  \n- **`requests` library**  \n  ```bash\n  pip install requests\n  ```\n- **GitLab Personal Access Token** with **`api`** scope  \n- **GitHub Personal Access Token** with **`repo`** scope  \n\n---\n\n## Installation\n\n1. **Clone this repository**  \n   ```bash\n   git clone https://gitlab.com/bocaletto-luca/gitlab-to-github-auto.git\n   cd gitlab-to-github-auto\n   ```\n\n2. **(Optional) Create \u0026 activate a virtual env**  \n   ```bash\n   python3 -m venv venv\n   source venv/bin/activate\n   ```\n\n3. **Install dependencies**  \n   ```bash\n   pip install requests\n   ```\n\n---\n\n## Configuration\n\nOpen `gitlab_to_github_auto_update.py` and set:\n\n```python\n# GitLab settings\nGITLAB_URL      = \"https://gitlab.com/api/v4\"\nGITLAB_TOKEN    = \"your_gitlab_token_here\"\nGITLAB_USERNAME = \"your-username\"\n\n# GitHub settings\nGITHUB_API_URL  = \"https://api.github.com\"\nGITHUB_TOKEN    = \"your_github_token_here\"\nGITHUB_USERNAME = \"your-username\"\n```\n\n\u003e **Security Note:**  \n\u003e Never commit your tokens in plaintext. Use environment variables or a `.env` file (excluded via `.gitignore`).\n\n---\n\n## Usage\n\nMake the script executable and run:\n\n```bash\nchmod +x gitlab_to_github_auto_update.py\n./gitlab_to_github_auto_update.py\n```\n\nOr simply:\n\n```bash\npython3 gitlab_to_github_auto_update.py\n```\n\nYou’ll see console output for each project—whether it was created or already existed, and the status of the import trigger.\n\n---\n\n## How It Works\n\n1. **Fetch Projects**  \n   Requests `/projects?membership=true` on GitLab, handling pagination.  \n\n2. **Check/Create on GitHub**  \n   For each project name, checks `GET /repos/{user}/{project}`. Creates via `POST /user/repos` if missing.\n\n3. **Trigger Import**  \n   Calls `PUT /repos/{user}/{project}/import` on GitHub, passing the GitLab HTTP URL plus credentials for private repos.\n\n---\n\n## Contributing\n\nBug reports, feature requests, and pull requests are welcome!  \n1. Fork the repo.  \n2. Create a feature branch.  \n3. Open a Merge Request here on GitLab.  \n\n---\n\n## License\n\nThis project is licensed under the MIT License. See [LICENSE](LICENSE) for details.\n\n---\n\n*Made with ❤️ by bocaletto-luca*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbocaletto-luca%2Fgitlab-to-github-auto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbocaletto-luca%2Fgitlab-to-github-auto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbocaletto-luca%2Fgitlab-to-github-auto/lists"}