Skip to content

sync.yml 的 merge 式同步会让 fork 和上游永久分叉 #1502

Description

@chengww5217

我的 fork(chengww5217/edgetunnel)一直开着每日 Upstream Sync。今天对比发现文件内容和上游完全一致,但 compare 显示 ahead_by 5:

  • 3 个是 Beta2.1 #1437 / Beta2.1 #1439 / Beta2.1 #1442 的 merge commit。这几个在上游已经不在 main 的祖先链上了(应该是某次改写过历史),fork 在那之前同步过,就永远留了下来
  • 另外 2 个是同步自己生成的 Merge branch 'main' of https://github.com/cmliu/edgetunnel

历史一旦分叉,merge 式同步就只能一直叠 merge commit,永远回不到 fast-forward。另外 shallow_since 只拉一个月的历史,每次运行都会把老 commit 当成新提交列出来。

建议:内容一致时直接对齐上游(顺带清理脏历史),有本地改动再走原来的 merge,这样自己改过代码的 fork 不受影响。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions