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 (
.gitfolder) 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 and modifying branch protectionread: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
Release Process
Holocron uses a manually triggered release workflow:
- Prepare Release: Go to Actions -> Prepare Release and run it with the new version (e.g.,
1.2.0). This creates arelease/v1.2.0branch. - Verify: Ensure CI passes on the release branch.
- Publish: Create and push a tag
v1.2.0(or merge the release PR and tag main).git tag v1.2.0git push origin v1.2.0- This triggers Docker and PyPI publishing.
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
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
File details
Details for the file holocron_sync-1.1.5.tar.gz.
File metadata
- Download URL: holocron_sync-1.1.5.tar.gz
- Upload date:
- Size: 68.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43f80d6492664a00e656cb52895f9738c77a8d1f27565e19c1f461389b539b6e
|
|
| MD5 |
0b808a617839a89333d241ed9c2ffd7d
|
|
| BLAKE2b-256 |
a86cba5647cb71a6f2a9da648114a70c08c00ff695abce8ac2838fdfeeb3cb17
|
Provenance
The following attestation bundles were made for holocron_sync-1.1.5.tar.gz:
Publisher:
publish-release.yaml on Someniak/holocron
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
holocron_sync-1.1.5.tar.gz -
Subject digest:
43f80d6492664a00e656cb52895f9738c77a8d1f27565e19c1f461389b539b6e - Sigstore transparency entry: 774176954
- Sigstore integration time:
-
Permalink:
Someniak/holocron@b247bcc06a4a86798f65cbf165afc0672ea8a6c6 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Someniak
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-release.yaml@b247bcc06a4a86798f65cbf165afc0672ea8a6c6 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file holocron_sync-1.1.5-py3-none-any.whl.
File metadata
- Download URL: holocron_sync-1.1.5-py3-none-any.whl
- Upload date:
- Size: 18.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e93af2312c0b22518b1b8a2b029113923df629d5918d4ea89687cd6350a65786
|
|
| MD5 |
9dd0ee9832ee95e69d620d6a7b5992b7
|
|
| BLAKE2b-256 |
d32739a755f93282de98925f1338d40c8e7dbf5b1694f0b6e85f3135feb34a6e
|
Provenance
The following attestation bundles were made for holocron_sync-1.1.5-py3-none-any.whl:
Publisher:
publish-release.yaml on Someniak/holocron
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
holocron_sync-1.1.5-py3-none-any.whl -
Subject digest:
e93af2312c0b22518b1b8a2b029113923df629d5918d4ea89687cd6350a65786 - Sigstore transparency entry: 774176955
- Sigstore integration time:
-
Permalink:
Someniak/holocron@b247bcc06a4a86798f65cbf165afc0672ea8a6c6 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Someniak
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-release.yaml@b247bcc06a4a86798f65cbf165afc0672ea8a6c6 -
Trigger Event:
workflow_dispatch
-
Statement type: