fix(deploy): force push main branch

This commit is contained in:
2026-07-01 17:41:11 +08:00
parent 94bb6adbb5
commit 4253da4e4c
+7 -2
View File
@@ -13,8 +13,13 @@ push_to_remote() {
return 1
fi
local push_args=()
if [ "$branch" = "main" ]; then
push_args+=("--force")
fi
echo "=========================================="
echo "git push $remote $branch ..."
echo "git push ${push_args[*]} $remote $branch ..."
echo "=========================================="
local current=$(git branch --show-current 2>/dev/null || echo "unknown")
@@ -29,7 +34,7 @@ push_to_remote() {
return 1
fi
git push "$remote" "$branch"
git push "${push_args[@]}" "$remote" "$branch"
if [ $? -eq 0 ]; then
echo "=========================================="