Home Posts Projects

Adding gitignored files into git worktrees with Claude Code

04-05-2026

  • https://code.claude.com/docs/en/worktrees#copy-gitignored-files-into-worktrees
  • creating a git worktree creates a fresh checkout, untracked files are not copied over (ie .env)
  • this file uses .gitignore syntax. Only files that match a pattern and are also gitignored are copied, so tracked files are never duplicated.

Related

19-07-2022

Black excludes files in gitignore

20-02-2026

Working with git worktrees

15-05-2022

Ignoring Revisions with Git Blame

© 2026 Luke Miloszewski

Email Address GitHub Twitter