en un clic
upstream-sync-curator
// 用于这个仓库中“先分析 upstream 提交与代码变更,再按功能主题选择性引入 upstream 变更;所有操作在临时 worktree 中完成,并在难解冲突时优先保留当前 fork 实现”。当用户提到 upstream sync、同步源仓库、选择性合并 upstream、分析上游提交、挑功能合并等意图时使用。仅适用于 nervmor/codexui 与其上游 friuns2/codexUI。
// 用于这个仓库中“先分析 upstream 提交与代码变更,再按功能主题选择性引入 upstream 变更;所有操作在临时 worktree 中完成,并在难解冲突时优先保留当前 fork 实现”。当用户提到 upstream sync、同步源仓库、选择性合并 upstream、分析上游提交、挑功能合并等意图时使用。仅适用于 nervmor/codexui 与其上游 friuns2/codexUI。
Use only when the user explicitly mentions Codex parity, codex-app-parity, Codex.app parity, or asks to compare against the installed Codex desktop app.
Use when the user asks to review GitHub pull requests, identify concrete risks, and write review comments with `gh`. Focus on actionable findings, not summaries.
Use when the user explicitly asks to accept or merge a GitHub pull request and the PR must show as merged on GitHub, not only in local git history.
| name | upstream-sync-curator |
| description | 用于这个仓库中“先分析 upstream 提交与代码变更,再按功能主题选择性引入 upstream 变更;所有操作在临时 worktree 中完成,并在难解冲突时优先保留当前 fork 实现”。当用户提到 upstream sync、同步源仓库、选择性合并 upstream、分析上游提交、挑功能合并等意图时使用。仅适用于 nervmor/codexui 与其上游 friuns2/codexUI。 |
仅用于本仓库 nervmor/codexui 与上游 friuns2/codexUI 之间的选择性同步。
固定上游地址:
https://github.com/friuns2/codexUI.git
不要直接同步整个 upstream。 固定执行“两阶段”流程:先分析 upstream 提交与代码变更,按功能主题整理候选变更;再根据用户选中的功能主题做选择性引入。
当用户提到以下意图时触发:
仅适用于本仓库及其 upstream friuns2/codexUI。
git status --short
origin 是否指向当前 fork nervmor/codexui。git remote -v
upstream,并强制使用 HTTPS 地址,不要使用 SSH。git remote get-url upstream
git remote remove upstream
git remote add upstream https://github.com/friuns2/codexUI.git
ts="$(date +%Y%m%d-%H%M%S)"
tmp_branch="upstream-sync-${ts}"
tmp_dir="$(mktemp -d -t codexui-upstream-sync-XXXXXX)"
git worktree add -b "${tmp_branch}" "${tmp_dir}" main
fetch、log、diff、cherry-pick、merge 都只在临时 worktree 内执行。
不要在主工作区直接做任何 upstream 分析或引入操作。origin/main 和 upstream/main。cd "${tmp_dir}"
git fetch origin main
git fetch upstream main
merge-base。base_commit="$(git merge-base origin/main upstream/main)"
echo "${base_commit}"
upstream-only commits,并按时间顺序和改动范围整理。git log --reverse --no-merges --oneline "${base_commit}..upstream/main"
git diff --stat "${base_commit}..upstream/main"
建议输出格式:
功能主题:<name>
commits:<sha1>, <sha2>, ...
范围:<files/dirs>
风险:低 / 中 / 高
冲突点:<areas>
建议:推荐引入 / 可选 / 暂不建议
默认粒度是“功能主题”,而不是“整支 upstream”。
cherry-pick。git cherry-pick <commit-a> <commit-b> <commit-c>
upstream/main 引入。git restore --source=upstream/main -- path/to/file path/to/dir
git add path/to/file path/to/dir
git commit -m "Selectively import upstream <theme-name>"
merge,并把它当作最后手段。git merge --no-ff upstream/main
不要把受控 merge 当成默认方案。
默认原则:尽量保留 upstream 的非冲突改动。
ours,放弃 upstream 在该冲突点上的改动。可接受的处理方式示例:
git checkout --ours -- path/to/conflicted-file
git add path/to/conflicted-file
或在确实无法安全吸收时,保留当前 fork 实现并放弃对应冲突块。
明确禁止以下行为:
“以我的修改为准”的含义仅限冲突区域:没有冲突的 upstream 改动默认允许被吸收。
main。friuns2/codexUIhttps://github.com/friuns2/codexUI.gitcherry-pick,其次文件级引入,最后才是受控 merge