Skip to main content

Holocron: The Ultimate Git Mirroring Tool

Project description

Holocron

The "Ultimate" Git Mirroring Tool

          /\
         /  \
        / /\ \
       / /  \ \
      / /    \ \
     /_/______\_\
     \ \      / /
      \ \    / /
       \ \  / /
        \ \/ /
         \  /
          \/

Holocron is a powerful Python application designed to mirror your GitHub repositories to a local directory or a self-hosted GitLab instance. It supports parallel syncing, continuous watch mode, and local-only backups (no GitLab required). Ideal if you need a local backup for any reason.

Features

  • Parallel Syncing: Sync multiple repositories concurrently for maximum speed.
  • Continuous Watch Mode: Polls for changes and syncs only when necessary (smart redundancy checks).
  • Two-Way Mirroring: Creates a bare mirror (.git folder) for safety AND an optional checkout for visibility.
  • Dockerized: Runs as a lightweight container.
  • Backup Level:
    • Full: GitHub -> Local -> GitLab
    • Backup-Only: GitHub -> Local (No GitLab token needed)

Quick Start

PyPI (pip / uv)

Valuable for local usage or scripting.

pip install holocron-sync
# or
uv tool install holocron-sync

Docker (Recommended for continuous operation)

Run Holocron instantly with a single command:

docker run -d \
  -e GITHUB_TOKEN="your_github_token" \
  -v $(pwd)/mirror-data:/app/mirror-data \
  ghcr.io/someniak/holocron

For full configuration options, environment variables, and Docker Compose examples, please refer to the Docker Guide.

Running from Source

# Install dependencies
uv sync

# Run a one-time backup of all your repos locally (visible files)
export GITHUB_TOKEN=your_token
uv run python src/holocron.py --backup-only --checkout --concurrency 10

Configuration

Holocron uses environment variables for secrets:

Variable Description Required
GITHUB_TOKEN Your GitHub Personal Access Token (repo scope) Yes
GITLAB_TOKEN Your GitLab Personal Access Token (api scope) No (if --backup-only)
GITLAB_API_URL URL to your GitLab API (default: http://gitlab.local/api/v4) No (if --backup-only)
GITHUB_API_URL URL to your GitHub API (default: https://api.github.com) No

API Permissions

Ensure your tokens have the minimum required scopes:

GitHub Token (GITHUB_TOKEN)

  • repo (Full control of private repositories) - Required for reading private repos
  • read:org (Read org and team membership) - Required for fetching organization repos

GitLab Token (GITLAB_TOKEN)

  • api (Grants complete read/write access to the API) - Simplest option
  • OR read_repository + write_repository - More granular control

Command Line Arguments

Flag Default Description
--watch False Run continuously in a loop
--interval 60 Seconds to sleep between checks in watch mode
--window 60 Sync only repos pushed within the last N minutes
--backup-only False Mirror locally only, do not push to GitLab
--checkout False Create a visible working directory alongside the mirror
--concurrency 5 Number of parallel sync threads
--storage ./mirror-data Directory to store repositories
--dry-run False Print what would happen without doing it
--verbose False Enable detailed debug logging

Development

Running Tests

To run the test suite:

uv run pytest

With coverage:

uv run pytest --cov=src

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

holocron_sync-1.0.0.tar.gz (60.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

holocron_sync-1.0.0-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file holocron_sync-1.0.0.tar.gz.

File metadata

  • Download URL: holocron_sync-1.0.0.tar.gz
  • Upload date:
  • Size: 60.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for holocron_sync-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e8d136ef0c49eb67afc92670f95a5ea5c50f32d8a90dc1cb63252dc060a77bc0
MD5 8ced0a2c4e193e09a51d9e8c60cf6e10
BLAKE2b-256 3fe22c8850c1d6afec917a72a30b2f24145894a76121499bac784f922077a16d

See more details on using hashes here.

Provenance

The following attestation bundles were made for holocron_sync-1.0.0.tar.gz:

Publisher: pypi-publish.yaml on Someniak/holocron

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file holocron_sync-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: holocron_sync-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 14.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for holocron_sync-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4edf0bcc878c0901dda32a946b5bb08266157ca78a5e0812a4fc514eef8a4455
MD5 7492b6eacbb2097cdd60eef5272d8acd
BLAKE2b-256 c56ccc2b156331b3e1d2587d0c2271e41475683c652a067817951e6edf70bd0f

See more details on using hashes here.

Provenance

The following attestation bundles were made for holocron_sync-1.0.0-py3-none-any.whl:

Publisher: pypi-publish.yaml on Someniak/holocron

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page