-
Notifications
You must be signed in to change notification settings - Fork 31
Description
Description
When I run gtr new , gtr creates a fresh worktree and copies only tracked files or selected include patterns.
This works well, but for large projects (JavaScript/TypeScript, PHP, Python, Go, etc.), re-installing dependencies in each new worktree is slow.
Feature Request
Add an option to automatically copy certain git-ignored folders to the new worktree during creation.
Example directories:
- node_modules
- vendor
- .venv
- dist or build cache folders
- any other heavy folders defined by user config
The goal is to dramatically speed up first-time worktree setup.
Possible API
Option 1: Configurable through .gtrconfig
[gtr.copyIgnored]
include = [
"node_modules",
"vendor",
".venv",
]
Option 2: Flags when creating a new worktree
gtr new feature-x --copy-ignored
gtr new feature-x --copy-ignored=node_modules --copy-ignored=vendor
Why this matters
In many workflows:
- Installing node_modules can take several minutes
- PHP vendor installs take time
- Python environments need to be rebuilt
- Rebuilding caches slows down developer productivity
Copying these folders would make gtr new near-instant for large repositories.
Notes
This should be optional to avoid copying very large directories when not needed.
Should work similarly to the existing gtr.copy.include behavior but for ignored files.
Should avoid overwriting existing files unless explicitly allowed.
Benefit
Huge improvement in developer experience when working across multiple features or PR reviews in parallel.