From 4253da4e4c008d45730f13c5a486a0ca5f155b2d Mon Sep 17 00:00:00 2001 From: chenhang Date: Wed, 1 Jul 2026 17:41:11 +0800 Subject: [PATCH] fix(deploy): force push main branch --- scripts/deploy/_deploy_lib.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/deploy/_deploy_lib.sh b/scripts/deploy/_deploy_lib.sh index 626ef7cc..addef5aa 100755 --- a/scripts/deploy/_deploy_lib.sh +++ b/scripts/deploy/_deploy_lib.sh @@ -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 "=========================================="