worktree-parallel
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWorktree Parallel
并行Worktree使用
Workflow
工作流程
- Confirm the repo root (use current working directory unless the user specifies another repo).
- Determine a feature slug and branch name.
- Default branch pattern: .
feature/<slug> - If the user already has a branch name, use it.
- Default branch pattern:
- Choose a base directory for linked worktrees.
- Default for this repo: (create it if missing).
../<project_name>-wt
- Default for this repo:
- Create the worktree.
- New branch:
git worktree add -b feature/<slug> <base>/<slug> - Existing branch:
git worktree add <base>/<slug> <branch>
- New branch:
- Bootstrap the new worktree dependencies.
cd <path> && pnpm run setup-worktree- If setup fails, resolve bootstrap issues before opening the parallel session.
- Open the worktree in the editor.
- Use (Cursor supports the
code -n <path>CLI).code - If is unavailable, ask for the preferred editor command (e.g.,
code,cursor -n, or another).code
- Use
- Suggest a parallel Codex session in the new worktree.
cd <path> && codex
- Confirm with if needed.
git worktree list - If the new session will run tests, start and use a dev server from that same worktree only, then stop it after tests.
- 确认仓库根目录(除非用户指定其他仓库,否则使用当前工作目录)。
- 确定功能标识(slug)和分支名称。
- 默认分支格式:。
feature/<slug> - 如果用户已有分支名称,则使用该名称。
- 默认分支格式:
- 选择链接式worktree的基础目录。
- 本仓库的默认路径:(如果不存在则创建)。
../<project_name>-wt
- 本仓库的默认路径:
- 创建worktree。
- 新分支:
git worktree add -b feature/<slug> <base>/<slug> - 已有分支:
git worktree add <base>/<slug> <branch>
- 新分支:
- 引导新worktree的依赖安装。
cd <path> && pnpm run setup-worktree- 如果引导失败,先解决依赖安装问题再开启并行会话。
- 在编辑器中打开worktree。
- 使用(Cursor支持
code -n <path>命令行工具)。code - 如果不可用,询问用户偏好的编辑器命令(例如
code、cursor -n或其他)。code
- 使用
- 建议在新worktree中开启并行Codex会话。
cd <path> && codex
- 如有需要,使用确认。
git worktree list - 如果新会话需要运行测试,仅在该worktree中启动并使用开发服务器,测试完成后停止服务器。
Safety
注意事项
- Do not use unless the user explicitly asks.
--force - Do not remove existing worktrees unless the user requests cleanup.
- Do not stop dev servers you did not start.
- 除非用户明确要求,否则不要使用参数。
--force - 除非用户请求清理,否则不要删除已有的worktree。
- 不要停止你未启动的开发服务器。
Optional Cleanup (only if asked)
可选清理操作(仅当用户要求时执行)
git worktree remove <path>git branch -d <branch>
git worktree remove <path>git branch -d <branch>