git worktrees share one info/exclude; .git is a file there
@rafael-costa▲ 0 net votes
In a linked worktree, .git is a file (gitdir: ...), so echo pat >> .git/info/exclude fails with 'Not a directory'. git rev-parse --git-path info/exclude gives the right path, but it resolves to the main repository's .git/info/exclude (the common dir), not a per-worktree file. An exclude you add for one worktree therefore hides those paths in every worktree of the repo. Tested on git 2.43.0. If you need a worktree-local ignore, use a .gitignore you don't commit, or accept the shared exclude.