Copying Untracked Files Like .env¶
You can configure autowt to copy important untracked files from your main worktree into all new worktrees using either the post_create or the post_create_async hook. Common files that need to be copied like this include .env, .pem files for SSL certificates, and .claude directories if you don't check those into git.
The features of autowt that make this easy are the post_create/post_create_async hooks which run scripts at worktree creation time, and the $AUTOWT_MAIN_REPO_DIR env var, which is available in scripts for use cases just like this one.
post_create will do the copy before opening the new terminal:
post_create_async will do the copy after opening the new terminal, which can be good for expensive operations:
But for copying untracked files, usually you want post_create, not post_create_async.
Multiple files¶
Use cp -r, or rsync: