git-sync: pull 失败时提示 pull.rebase=true 场景的绕过方法

This commit is contained in:
2026-09-14 18:55:00 +08:00
parent bd77c48829
commit d3802c3569
2 changed files with 8 additions and 0 deletions

View File

@@ -75,4 +75,5 @@ metadata:
- sync 检测到 unmerged paths(`git ls-files -u`)会直接拒绝提交,先解决冲突
- `resolve remote`(`git reset --hard`)与 `resolve local`(force push)都会丢内容,必须先经 clarify 拿到用户明确选择,脚本侧再加 `GIT_SYNC_CONFIRM=yes`
- push 失败(码 3)通常是 pull 后又有人推了东西:重新 `status`,再走分叉决策
- **`pull.rebase=true` 的仓库**(本机 nexus 即如此):有未暂存改动时 ff-only pull 必失败报 "cannot pull with rebase",哪怕与远端无文件重叠——先用 `git diff --name-only HEAD origin/main` 确认无重叠,再 `git -c pull.rebase=false pull --ff-only`,不必惊动用户。脚本遇此会自动打印 hint
- 脚本由其他技能/agent 复用时同样适用,别只当本技能专用