dubstack
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDubStack CLI
DubStack CLI
Key Concepts
核心概念
- Stack: Chain of dependent branches (e.g., ->
main->feat/a)feat/b - Root: The base branch (usually )
main - Restacking: Rebasing branches onto their updated parents (e.g., after parent changes)
- Submit: Pushing branches and creating/updating GitHub PRs for the entire stack
- Stack: 相互依赖的分支链(例如:->
main->feat/a)feat/b - Root: 基础分支(通常为)
main - Restacking: 将分支变基到更新后的父分支上(例如父分支变更后)
- Submit: 推送分支并为整个分支栈创建/更新GitHub PR
Prerequisites
前置条件
- Install: or
npm install -g dubstackbrew install wiseiodev/dubstack/dubstack - Auth: ensure is done (DubStack uses
gh auth loginCLI for PRs)gh - Init: Auto-initialized on first (or run
dub create)dub init
- 安装: 或
npm install -g dubstackbrew install wiseiodev/dubstack/dubstack - 认证: 确保已完成(DubStack 使用
gh auth loginCLI 处理PR相关操作)gh - 初始化: 首次执行时会自动初始化(或手动运行
dub create)dub init
Quick Decision Trees
快速决策指南
"I need to start a new feature or stack"
"我需要开始开发新功能或创建分支栈"
- Create branch & commit:
dub create <name> -am "<msg>" - Create branch only: (then git add/commit manually)
dub create <name>
- 创建分支并提交:
dub create <name> -am "<msg>" - 仅创建分支: (之后手动执行git add/commit)
dub create <name>
"I need to visualize my work"
"我需要查看我的工作状态"
- See stack tree:
dub log - Switch branches (interactive): (or
dub checkout)dub co - Switch branch directly:
dub checkout <name>
- 查看分支栈树状图:
dub log - 交互式切换分支: (或别名
dub checkout)dub co - 直接切换分支:
dub checkout <name>
"I need to update code"
"我需要更新代码"
- Modify current branch: standard git workflow (,
git add)git commit
- 修改当前分支: 使用标准Git工作流(,
git add)git commit - 更新父分支: ,修改后提交
dub co <parent> - 将父分支变更同步到子分支:
dub restack
"I need to update code"
"我需要提交我的工作成果"
- Modify current branch: standard git workflow (,
git add)git commit - Update parent branch: , modify, commit
dub co <parent> - Propagate parent changes to children:
dub restack - Propagate parent changes to children:
dub restack
- 提交整个分支栈: (为栈中所有分支创建/更新PR)
dub ss - 预览提交效果:
dub ss --dry-run
"I need to submit my work"
"我操作出错了"
- Submit entire stack: (sets up PRs for all branches in stack)
dub ss - Preview submission:
dub ss --dry-run
- 撤销上一次DubStack操作: (撤销创建/重排栈操作)
dub undo
"I made a mistake"
命令参考
- Undo last DubStack action: (reverses create/restack)
dub undo
| 命令 | 描述 |
|---|---|
| 创建分支、暂存所有变更并提交(类似 |
| 显示当前分支栈的ASCII树状图 |
| 交互式分支选择器(别名 |
| 推送分支并创建/更新PR( |
| 将栈中所有分支变基到各自的父分支上 |
| 撤销上一次 |
| 手动初始化DubStack(可选) |
Command Reference
故障排除
| Command | Description |
|---|---|
| Create branch, stage all, commit (like |
| Show ASCII tree of current stack |
| Interactive branch picker (alias |
| Push branches & create/update PRs (alias for |
| Rebase all branches in stack onto their parents |
| Undo last |
| Manually initialize DubStack (optional) |
| 问题 | 解决方案 |
|---|---|
| 未认证 | 运行 |
| 分支名称已存在 | 选择其他名称 |
| 重排栈时出现冲突 | 解决文件冲突,执行 |
| 需要与main分支同步 | |
| 意外修改了错误的分支 | 如果是通过DubStack创建的分支,执行 |
Troubleshooting
完整文档
| Problem | Solution |
|---|---|
| "Not authenticated" | Run |
| "Branch name exists" | Choose different name |
| "Conflict during restack" | Resolve files, |
| "Need to sync with main" | |
| "Accidentally modified wrong branch" | |
请查看仓库根目录下的获取完整使用教程。
QUICKSTART.mdFull Documentation
—
See in the repo root for a complete walkthrough.
QUICKSTART.md—