Kalandra can be used to mirror multiple Git repositories across different locations in an efficient manner without having to keep a full copy of any of the repositories.
All changes in Git are kept as objects (commits, tags, trees, etc.). Branches and tags are just references to objects. The Git Protocol allows for discovering what objects are present on the given server. It also allows to negotiate the minimal set of objects (or deltas of objects) that need to be transferred to synchronize with the server.
The naive approach to mirroring a Git repository is:
# First time
git clone --mirror upstream
# Every X minutes
git fetch --prune upstream
git push --mirror downstreamThis works fine most of the time, but requires that you maintain a local copy the repository that you are mirroring.
What Kalandra does instead, is to that it acts as a broker between the two servers. No data is persisted by the running service. We negotiate the minimal pack needed to syncronize the mirror with upstream and then only transfer the pack.
Planned features:
- optimize use of capabilities like
ofs-delta.
Install the project with all extras and dev tools using uv:
uv sync --all-extras --all-groupsRun the test suite:
uv run pytest -vvTBD
Copyright (c) 2024-2025 Łukasz Rekucki