git-worktree
Git worktree workflow helpers for parallel development on multiple branches
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
Git Worktree Workflow
Worktrees enable working on multiple branches simultaneously without stashing or switching.
Branch Naming Convention
Use semantic prefixes based on the type of work:
| Prefix | Use When | Example |
|---|---|---|
feat/ |
New functionality, enhancements, additions | feat/user-auth |
fix/ |
Bug fixes, corrections, repairs | fix/login-redirect |
enhancement/ |
Maintenance, dependencies, config updates | enhancement/update-deps |
refactor/ |
Code restructuring without behavior change | refactor/api-handlers |
docs/ |
Documentation only | docs/api-reference |
test/ |
Adding or updating tests | test/auth-coverage |
ci/ |
CI/CD pipeline changes | ci/github-actions |
style/ |
Formatting, whitespace (no code change) | style/lint-fixes |
perf/ |
Performance improvements | perf/query-optimization |
Layout
opencode-orca/
├── worktrees/ # Worktree container (gitignored)
│ ├── feat-login/ # Branch: feat/login
│ └── fix-build/ # Branch: fix/build
├── src/
└── ...
Commands
| Command | Description |
|---|---|
bun run wt:new <branch> [base] |
Create worktree (auto bun install) |
bun run wt:list |
List all worktrees |
bun run wt:rm <dirname> |
Remove worktree and prune |
Examples
# Create new feature branch from main
bun run wt:new feat/auth
# Create hotfix from production tag
bun run wt:new hotfix/urgent v1.2.0
# Attach to existing branch
bun run wt:new existing-branch
# List worktrees
bun run wt:list
# Remove worktree (by folder name)
bun run wt:rm feat-auth
Updating a Worktree from Main
When main has new commits you want in your feature branch:
cd worktrees/feat-login
# Fetch latest
git fetch origin
# Merge
git merge origin/main
Or from anywhere using -C:
git -C worktrees/feat-login fetch origin
git -C worktrees/feat-login merge origin/main
Notes
- Branch names are sanitized:
feat/login→feat-loginfolder - Dependencies are installed automatically on creation
- Each worktree is independent — no shared node_modules with the main repo
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-01-20
- 索引更新时间
- 2026-01-26
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!