Basic Usage
Provide multiple names as arguments:myrepo-feature-authwith branchfeature-authmyrepo-feature-apiwith branchfeature-apimyrepo-bug-fixwith branchbug-fix
Batch Creation Output
When creating multiple worktrees, you’ll see progress for each:Batch Workflow
-1, -2, etc.)Handling Conflicts
Existing Directory
If a worktree directory already exists, it’s skipped:Branch Name Conflicts
If a branch name is taken, GWTree appends a counter:Creation Failures
If a worktree fails to create, the batch continues:Silent Mode for Batch
Batch creation automatically uses saved configuration:- No interactive prompts for uncommitted changes
- No prompts for branch switching
- No prompts for pulling from remote
- Uses saved editor and dependency preferences
Combine with Skip Editor
Prevent opening editors for all worktrees:- You want to set up worktrees first, then open them manually
- You’re scripting worktree creation
- You’re working remotely via SSH
Use Cases
Sprint Planning
Create worktrees for all sprint tasks:Feature Branches
Set up parallel feature development:Bug Triage
Quickly create worktrees for multiple bug fixes:Experimentation
Create multiple experimental branches:Performance Considerations
Dependency Installation
Installing dependencies for multiple worktrees can take time:Editor Windows
Opening many editor windows can be resource-intensive:Comparison with Single Creation
| Feature | Single Creation | Batch Creation |
|---|---|---|
| Interactive prompts | Yes (unless -y) | No |
| Uncommitted changes | Prompts to stash | No action |
| Branch switching | Prompts to switch | No action |
| Pull from remote | Prompts to pull | No action |
| Dependency install | Based on config | Based on config |
| Editor opening | Based on config | Based on config |
| Error handling | Stops on error | Continues on error |
| Summary | Shows cd command | Shows all cd commands |
Examples
Create Three Features
Create Without Editor
Ticket-Based Workflow
myrepo-JIRA-101myrepo-JIRA-102myrepo-JIRA-103
Next Steps
- Learn about managing worktrees to track and remove worktrees
- Check merging and cleanup for completing work
- Optimize your workflow with configuration