-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Description
Problem
When working with multiple worktrees, developers often need to sync configuration files (especially .env files) from the main repo to worktrees after they've been created.
Current workflow requires manual commands:
cd /path/to/main-repo && find . -name ".env*" -type f -exec sh -c \
'mkdir -p "/path/to/worktree/$(dirname "$1")" && cp "$1" "/path/to/worktree/$1"' _ {} \;This is verbose, error-prone, and breaks the DX that gtr provides.
Proposed Solution
Add a git gtr copy command:
git gtr copy 1 my-feature --pattern ".env*"This would copy all matching files from the main repo to the worktree while preserving directory structure.
Use Cases
- Created a worktree with
--no-copybut now need env files - Updated
.envin main and need to propagate to existing worktrees - Selective sync without running full
postCreatehooks
Metadata
Metadata
Assignees
Labels
No labels