Commit 8645848
chore(repo): ignore
`.gitignore:129` carried `.claude/worktrees/` and nothing else, so a linked
worktree created at `<checkout>/.worktrees/NAME` — one of five registered
worktrees in a live container chose that path — showed up as `?? .worktrees/`.
A stop hook that asks for untracked files to be committed then points at the
one kind of path that must never be committed: the directory holds a `.git`
FILE whose content is `gitdir: /abs/path/.git/worktrees/NAME`, an absolute
pointer into one container's administrative state, plus a whole second
checkout of the repository.
Measured in a dedicated worktree, before and after:
git worktree add .worktrees/scratch HEAD
git status --porcelain before: `?? .worktrees/` after: clean
git check-ignore -v .worktrees before: exit 1 (no match) after: exit 0,
`.gitignore:131:.worktrees/`
The entry is the exact directory name, dot-prefixed and directory-only, in the
same unanchored form as its neighbour `.codex/`. It matches `.worktrees/` at
any depth and nothing else: `worktrees/`, `my-worktrees/`, `.worktrees-backup/`
and `docs/worktrees/` all still read as not ignored.
Claude-Session: https://claude.ai/code/session_01YKEjmbYNvYWJvWGSWx26zK
Co-authored-by: Claude <noreply@anthropic.com>.worktrees/ so an agent worktree inside the checkout is not untracked (#17468)1 parent fa23d69 commit 8645848
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
0 commit comments