mirrors a bare git repo to a remote machine over plain ssh and tar. made for storage boxes that have no git and a broken or locked down rsync, so the only thing you can count on is ssh with tar on the other side.

it works because git object and pack files never change once written. each run lists files on both sides, sends only what the remote is missing plus the small mutable stuff like refs and head, then deletes files that local gc removed. sending always happens before pruning, so the remote copy is a valid repo at every moment. restore is just a git clone of the remote directory.

to use it, edit the config block at the top with your local bare repo path, the ssh destination and the remote directory. key based ssh auth has to work without prompts. run it from cron or a timer. the first run copies everything, after that each run only moves a few kilobytes. a small freshness file with timestamp and head sha gets written next to the mirror directory each run.