git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Advice on per-worktree private gitignore?

From
D. Ben Knoble <ben.knoble@gmail.com>
Date
Apr 23, 2026, 21:26 UTC
Message-ID
<CALnO6CCXmA+ATT7CuyWkU6P8qmLCCpMi5Ppr1c78s0heznpVyw@mail.gmail.com>

Today we have $GIT_DIR/info/exclude for the main worktree, but $(git rev-parse --git-dir)/info/exclude for secondary worktrees does not actually contribute to ignore specs.

Is this a "we never got around to implementing that", an intentional omission, or something else? Since --git-dir is described as parsing $GIT_DIR, I would naturally combine that with the gitignore(1) manual to think that the worktree.git/info/exclude should work.

(Currently it seems that main-worktree/.git/info/exclude applies to all worktrees, which may not be desirable in some circumstances.)

Thanks,
-- 
D. Ben Knoble
Next: brian m. carlson
Message 1 of 2 in “Advice on per-worktree private gitignore?”
  1. D. Ben KnobleApr 23, 2026
  2. brian m. carlsonApr 23, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.