Skip to content

Commit 0d91f6e

Browse files
committed
CI split-code.sh – try a different way of providing credentials
1 parent af40bb5 commit 0d91f6e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

bin/split-code.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,18 @@ split_and_push() {
7777
fi
7878
git remote remove origin 2>/dev/null || true
7979
git remote add origin "$repo_url"
80-
git push -u origin --all
80+
# Fetch remote default branch if exists (for safer force-with-lease in the future)
81+
git fetch origin "${DEFAULT_BRANCH}" --depth=1 || true
82+
# Push the filtered history to the remote default branch, overwriting if needed
83+
git push -u origin HEAD:"${DEFAULT_BRANCH}" --force
8184
git push origin --tags || true
8285
popd >/dev/null
8386
rm -rf "$tmp"
8487
else
8588
# Fallback: subtree split creates a synthetic branch with the path history
8689
local split_branch="split-$(basename "$pkg_dir")-$(date +%s)"
8790
git subtree split --prefix="$pkg_dir" -b "$split_branch" >/dev/null
88-
git push "$repo_url" "$split_branch:${DEFAULT_BRANCH}"
91+
git push --force "$repo_url" "$split_branch:${DEFAULT_BRANCH}"
8992
# Push tags that include this history is non-trivial with subtree; skipping here
9093
git branch -D "$split_branch" >/dev/null
9194
fi

0 commit comments

Comments
 (0)