Loading...
Loading...
Compare original and translation side by side
~/code~/code| Tool | Type | Required | Install |
|---|---|---|---|
| git | cli | Yes | |
| git-workflow | skill | No | Included in |
Do NOT proactively verify these tools on skill load. If a command fails due to a missing tool, directly guide the user through installation and configuration step by step.
| 工具 | 类型 | 是否必需 | 安装方式 |
|---|---|---|---|
| git | 命令行工具 | 是 | |
| git-workflow | 技能 | 否 | 包含在 |
请勿在技能加载时主动验证这些工具。如果因缺少工具导致命令失败,请直接逐步引导用户完成安装和配置。
| User says | Mode |
|---|---|
| 「下班同步」or "push" | Push |
| 「上班更新」or "pull" | Pull |
| 「同步代码」「code-sync」 | Ask user |
| 用户指令 | 模式 |
|---|---|
| 「下班同步」或 "push" | 推送(Push) |
| 「上班更新」或 "pull" | 拉取(Pull) |
| 「同步代码」「code-sync」 | 询问用户 |
bash scripts/scan.sh # Push: local data only
bash scripts/scan.sh --fetch # Pull: fetch remote first (10s timeout/repo)pathnamebranchremoteremote_urldirty_counthas_upstreamaheadbehindfetch_error--fetchbash scripts/scan.sh # 推送模式:仅扫描本地数据
bash scripts/scan.sh --fetch # 拉取模式:先拉取远程数据(每个仓库超时10秒)pathnamebranchremoteremote_urldirty_counthas_upstreamaheadbehindfetch_error--fetch| Category | Condition | Action |
|---|---|---|
| up-to-date | | Report |
| needs-push | | Auto |
| dirty | | Interactive |
| no-upstream | | Ask user |
| Category | Condition | Action |
|---|---|---|
| up-to-date | | Report |
| needs-pull | | Auto |
| dirty+behind | | Interactive |
| fetch-error | | Report, skip |
| 分类 | 条件 | 操作 |
|---|---|---|
| 已同步 | | 报告状态 |
| 需要推送 | | 自动执行 |
| 脏仓库 | | 交互式处理 |
| 无上游分支 | | 询问用户 |
| 分类 | 条件 | 操作 |
|---|---|---|
| 已同步 | | 报告状态 |
| 需要拉取 | | 自动执行 |
| 脏仓库+落后远程 | | 交互式处理 |
| 拉取失败 | | 报告并跳过 |
| Situation | Steps |
|---|---|
| Dirty repo (push) | |
| No upstream (push) | Report → ask: set upstream and push ( |
| ff-only fails (pull) | |
| Dirty + behind (pull) | Report both issues → ask: stash and pull (stash, pull --ff-only, pop), or skip |
| 场景 | 处理步骤 |
|---|---|
| 脏仓库(推送模式) | 执行 |
| 无上游分支(推送模式) | 报告状态 → 询问:设置上游并推送( |
| ff-only执行失败(拉取模式) | 执行 |
| 脏仓库+落后远程(拉取模式) | 报告两个问题 → 询问:暂存并拉取(暂存、拉取--ff-only、恢复暂存),或跳过 |
undefinedundefinedundefinedundefined| Issue | Fix |
|---|---|
| Check |
| Check network, SSH keys |
| ff-only fails | Rebase or merge manually |
| Push rejected | Pull first, then push |
| 问题 | 解决方法 |
|---|---|
| 检查 |
| 检查网络连接、SSH密钥 |
| ff-only执行失败 | 手动执行变基或合并操作 |
| 推送被拒绝 | 先拉取远程代码,再重新推送 |