From 8332e98068e31606986f3a16e357f2906853505c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=BA=E6=A2=B0=E5=B0=8F=E9=B8=BD?= <128568434+jixiexiaoge@users.noreply.github.com> Date: Sat, 7 Dec 2024 17:52:15 +0800 Subject: [PATCH] Update sync-to-gitea.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 发 --- .github/workflows/sync-to-gitea.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sync-to-gitea.yml b/.github/workflows/sync-to-gitea.yml index 27e79f9..a370b73 100644 --- a/.github/workflows/sync-to-gitea.yml +++ b/.github/workflows/sync-to-gitea.yml @@ -18,7 +18,7 @@ jobs: git config --global user.name "Your Name" git config --global user.email "your-email@example.com" - - name: Push all branches to Gitea + - name: Push all branches to Gitea (force push) env: GITEA_URL: '124.220.61.41:5000' # 你的Gitea地址,不带 http:// GITEA_REPO: 'zhudongjer/openpilot' # Gitea上的仓库名 @@ -32,6 +32,7 @@ jobs: # 获取每个分支的名称 branch_name=$(echo $branch | sed 's/origin\///') # 去掉 origin/ git checkout --track $branch - # 推送每个分支到 Gitea - git push http://your_gitea_user:${{ secrets.GITEA_TOKEN }}@${GITEA_URL}/${GITEA_REPO}.git $branch_name:$branch_name + + # 强制推送每个分支到 Gitea,覆盖远程分支 + git push --force http://your_gitea_user:${{ secrets.GITEA_TOKEN }}@${GITEA_URL}/${GITEA_REPO}.git $branch_name:$branch_name done