Skip to content

Option to copy git-ignored folders (node_modules, vendor, build caches) to speed up new worktree creation #17

Description

@varunm1813

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.

Activity

  1. helizaga commented on Nov 22, 2025

    @helizaga
    Contributor

    #23 solves the same use case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions