Files
werkator/tools/push-github-mirror.sh
T
mhoennigandClaude Sonnet 5 4d76a93927 Add a script to mirror main to GitHub after the move to Gitea
Werkator's canonical repository now lives on git.javagil.de; GitHub stays
around as a public mirror. This keeps its main branch in sync without
touching any other branch or the repo's other history.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-03 16:34:44 +02:00

20 lines
634 B
Bash
Executable File

#!/usr/bin/env bash
#
# Push the current main branch to the GitHub mirror.
#
# Werkator's canonical repository lives on git.javagil.de (Gitea, remote
# "origin"); GitHub stays around as a public read-only mirror (remote
# "github"). This script keeps that mirror's main branch in sync — nothing
# else: no other branches, no force-push, no tags. Run it after pushing main
# to origin, or set it up as a post-push hook / cron job if that becomes
# annoying to remember.
#
# Usage: tools/push-github-mirror.sh
set -euo pipefail
cd "$(dirname "$0")/.."
git fetch origin main
git push github refs/remotes/origin/main:refs/heads/main