Skip to content

feat(config): ✨ copy files into new worktrees - #36

Open
CarmeloCampos wants to merge 2 commits into
arturosdg:mainfrom
CarmeloCampos:feat/set-copy
Open

feat(config): ✨ copy files into new worktrees#36
CarmeloCampos wants to merge 2 commits into
arturosdg:mainfrom
CarmeloCampos:feat/set-copy

Conversation

@CarmeloCampos

@CarmeloCampos CarmeloCampos commented Aug 6, 2026

Copy link
Copy Markdown

What changed

Adds explicit copyFiles support for files that should be copied from the main repository into every newly created worktree. The TUI exposes the setting through the existing c configuration editor.

Example:

{
  "default": {
    "copyFiles": [".env", ".env.local"],
    "postCreateHook": "npm install"
  }
}

Benefits

  • Worktrees can start with local environment files without committing secrets to Git.
  • Eliminates repetitive manual copying after creating a worktree.
  • Runs before postCreateHook, so setup commands can immediately use copied configuration.
  • Supports per-repository overrides through the existing global configuration.
  • Validates paths and only copies explicit repository-relative files, preventing accidental directory or outside-repository copies.
  • Preserves existing configuration compatibility with an empty default array.

Scope

This intentionally supports explicit files only. Directories, glob patterns, symlinks, and exclusions are not included because they are outside the requested use case.

Validation

  • bun run build:single
  • git diff --check

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant