Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

herdr-worktreeinclude

A Herdr plugin that copies gitignored files (like .env) into newly created git worktrees, driven by a .worktreeinclude file — the same convention used by Claude Code.

A fresh worktree checkout contains only tracked files, so local configuration such as .env or .env.local is missing. This plugin hooks Herdr's worktree.created event and copies those files over automatically, whether the worktree is created from the sidebar (prefix+shift+g) or via herdr worktree create.

How it works

Put a .worktreeinclude file at your repository root. It uses .gitignore syntax:

.env
.env.local
config/secrets.json

When Herdr creates a worktree, the plugin copies every file that:

  1. matches a pattern in .worktreeinclude, and
  2. is gitignored in the source repository.

Tracked files are never copied (the checkout already has them), so sharing one .worktreeinclude between Claude Code and Herdr is safe.

Files under node_modules/ and files belonging to other worktree checkouts of the same repository are always skipped.

Install

From GitHub:

herdr plugin install tanshio/herdr-worktreeinclude

Or link a local clone:

git clone https://github.com/tanshio/herdr-worktreeinclude.git
herdr plugin link ./herdr-worktreeinclude

Requirements

  • Herdr >= 0.7.0
  • bash, git
  • jq or python3 (for parsing the event payload)

Troubleshooting

Inspect what the plugin did for recent worktrees:

herdr plugin log list --plugin tanshio.worktreeinclude

Each run logs the event payload and every file it copied.

License

MIT

About

Herdr plugin: copy gitignored files matching .worktreeinclude into newly created worktrees

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages