Skip to content

v1.0.0

Choose a tag to compare

@scienmanas scienmanas released this 29 Sep 17:17
· 16 commits to main since this release
38c1b02

GitSync v1.0.0

GitSync is a Python script that mirrors all your GitHub repositories to GitLab, so you always have an off-platform backup. Run it manually, as a cron job, or from CI/CD.

Features

  • Mirrors every GitHub repository to GitLab with full commit history
  • Supports both personal and group namespaces on GitLab (GITLAB_GROUP)
  • Configurable visibility for mirrored repos via REPO_VISIBILITY: public, private, or auto (matches each repo's original GitHub visibility)
  • Rich terminal UI with live progress and logging
  • Timestamped session logs saved in Logs/
  • Built-in automation: build.sh sets up the environment and deploy.sh schedules a cron job (with output logged to shell_logs.txt)
  • Dependencies managed with uv and a pinned uv.lock
  • Works on macOS and Linux

Requirements

  • Python 3.12+
  • uv
  • GitHub token with repo read access
  • GitLab token with api and write_repository scopes

Quick start

git clone https://github.com/scienmanas/GitSync.git
cd GitSync
uv sync
# create .env (see .env.example)
uv run python main.py

To schedule automated backups:

chmod +x build.sh deploy.sh
bash build.sh
bash deploy.sh   # prompts for a cron schedule, e.g. 0 2 * * *

Configuration

Variable Required Description
GITHUB_USER Yes GitHub username
GITHUB_TOKEN Yes GitHub token (repo read access)
GITLAB_USER Yes GitLab username
GITLAB_TOKEN Yes GitLab token (api, write_repository)
GITLAB_GROUP No GitLab group namespace
REPO_VISIBILITY No public, private, or auto

Known limitations

  • Windows is untested; testing and bug reports are welcome
  • GitLab's contribution graph may look different from GitHub's, but commit history is preserved
  • A full run typically takes 15-20 minutes depending on repo count and size

License

MIT