Skip to content

fix(backup): force-push tags to gitee to avoid conflicts - #819

Closed
re2zero wants to merge 1 commit into
linuxdeepin:masterfrom
re2zero:fix/gitee-tag-force-push
Closed

re2zero wants to merge 1 commit into
linuxdeepin:masterfrom
re2zero:fix/gitee-tag-force-push

Conversation

@re2zero

@re2zero re2zero commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

问题

同步到 Gitee 时, git push --tags origin 不带 --force,当 tag 已存在于 Gitee 远端(如之前同步过)时会被拒绝,导致整个 backup job 失败。

错误示例:

! [rejected] 1.2.9 -> 1.2.9 (already exists)
error: failed to push some refs to 'https://gitee.com/deepin-community/dde-cooperation.git'

修复

将 git push --tags origin 改为 git push -f --tags origin,与分支推送(已有 -f)保持一致,确保已存在的 tag 被更新而非拒绝。

影响

所有使用此共享 workflow 的仓库(如 dde-cooperation 等)在同步到 Gitee 时不再因 tag 已存在而失败。

Summary by Sourcery

Bug Fixes:

  • Prevent backup jobs from failing when tags already exist on Gitee by force-pushing tags during synchronization.

@deepin-ci-robot

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@sourcery-ai

sourcery-ai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Configuration

Force-push tags to Gitee so existing remote tags are updated instead of causing the backup workflow to fail.

  • .github/workflows/backup-to-gitee.yml L29

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@deepin-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: re2zero

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

When a tag already exists on the Gitee remote (e.g. from a previous
sync), 'git push --tags' without '--force' is rejected, causing the
entire backup job to fail.  Branches already use '-f'; apply the same
to tags so existing tags are updated instead of rejected.

Log: fix gitee tag sync conflict
Influence: backup-to-gitee no longer fails when a tag already exists

fix(backup): 强制推送 tag 到 gitee 以避免冲突

当 tag 已存在于 Gitee 远端(如之前同步过)时,不带 '--force' 的
'git push --tags' 会被拒绝,导致整个 backup job 失败。分支推送已使用
'-f';对 tag 做同样处理,确保已存在的 tag 被更新而非拒绝。

Log: 修复 gitee tag 同步冲突
Influence: backup-to-gitee 不再因 tag 已存在而失败
@re2zero
re2zero force-pushed the fix/gitee-tag-force-push branch from 7ba0a78 to 3eed803 Compare November 20, 2026 03:22
@re2zero re2zero closed this Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants