disaster-control/tools/sync-mirror.sh
tegwick e7aa485c9f Complete DISCTL-WP-0002-T01: Forgejo off-Gitea mirror
Create private coulomb/disaster-control on forgejo.coulomb.social,
add mirror sync docs and tools/sync-mirror.sh, update registers and
README. Mark T01 done.
2026-07-07 20:28:58 +02:00

16 lines
No EOL
537 B
Bash
Executable file

#!/usr/bin/env bash
# Push current branch to the off-Gitea Forgejo mirror (R10).
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "${ROOT}"
if ! git remote get-url mirror &>/dev/null; then
echo "mirror remote missing — run: git remote add mirror forgejo-remote:coulomb/disaster-control.git" >&2
exit 1
fi
BRANCH="${1:-$(git branch --show-current)}"
echo "==> Pushing ${BRANCH} to mirror (forgejo-remote:coulomb/disaster-control.git)"
git push mirror "${BRANCH}" --tags
echo "==> Mirror sync complete"