fix git sync

This commit is contained in:
2026-08-12 18:03:20 +08:00
parent 05e49838f7
commit f7353f9d03

View File

@@ -32,6 +32,7 @@ jobs:
test -n "$GITVERSE_PAT" || { echo 'GITVERSE_PAT is not configured' >&2; exit 1; } test -n "$GITVERSE_PAT" || { echo 'GITVERSE_PAT is not configured' >&2; exit 1; }
remote="https://oauth2:${GITVERSE_PAT}@gitverse.ru/${GITVERSE_ORG}/${GITVERSE_REPO}.git" remote="https://oauth2:${GITVERSE_PAT}@gitverse.ru/${GITVERSE_ORG}/${GITVERSE_REPO}.git"
git remote add gitverse "$remote" git remote add gitverse "$remote"
# Populate local refs first, so a manual run mirrors every branch too. # Use a private ref namespace: Git will not overwrite the checked-out
git fetch origin '+refs/heads/*:refs/heads/*' # branch, and broken legacy submodule metadata is not traversed.
git push --prune --force gitverse 'refs/heads/*:refs/heads/*' git fetch --no-recurse-submodules origin '+refs/heads/*:refs/mirror/*'
git push --prune --force gitverse 'refs/mirror/*:refs/heads/*'