The {repo}-{name} Pattern
GWTree follows a consistent naming pattern for all worktrees:
- Predictability: Always know where to find worktrees
- Organization: Related worktrees are grouped alphabetically
- Clarity: The repository origin is immediately visible
- Uniqueness: Avoid conflicts with existing directories
Pattern Implementation
From the source code (src/commands/create.ts:47, 224):- Detects the repository name from the git root directory
- Combines it with your chosen worktree name
- Creates the directory in the parent folder
Directory Structure
Single Repository Example
Multi-Repository Example
Naming Examples
Quick Creation
When you provide a name directly, it’s used for both the worktree and branch:- Directory:
my-repo-feature-auth/ - Branch:
feature-auth
Interactive Creation
During interactive mode:- Directory:
my-repo-dashboard-redesign/ - Branch:
dashboard-redesign
Separate Names (Advanced)
Press ESC during name input to specify different worktree and branch names:- Directory:
my-repo-ui-v2/ - Branch:
feature/dashboard-redesign
Valid Name Characters
GWTree validates names to ensure compatibility with both filesystems and git:Allowed Characters
- Letters:
a-z,A-Z - Numbers:
0-9 - Special:
.(dot),_(underscore),/(slash),-(hyphen)
Naming Conventions
Feature Development
Bug Fixes
Experiments
Agent-Based Work
Branch Name Conflicts
GWTree automatically handles branch name conflicts by appending a counter:Example
If branchfeature already exists:
Directory Path Preview
GWTree shows the full path before creation:- Verify the parent directory location
- Understand the naming pattern
- Catch potential path issues early
Batch Creation Naming
Create multiple worktrees with custom names:- Has its own branch with the same name
- Lives in the parent directory
- Follows the
{repo}-{name}pattern - Gets dependencies installed automatically (if configured)
Edge Cases
Directory Already Exists
If the worktree directory already exists:Long Repository Names
For repos with long names likemy-super-long-repository-name:
Special Characters in Repo Name
Repository names with special characters are preserved:Finding Worktrees
List Command
View all worktrees for the current repository:Remove by Name
The remove command searches by worktree name:Merge by Name
Merge using any of these identifiers:Best Practices
Pattern Benefits
Consistency Across Projects
The same pattern works for any repository:Easy Navigation
Tab completion works naturally:Clean Organization
Alphabetical sorting groups related worktrees:Learn More
Git Worktrees
Learn about git worktrees fundamentals
Multi-Agent Workflow
See how naming patterns enable parallel development