Question: supporting multiple named ignore files (in addition to .gitignore)
- From
- ZH L <lzh2587379717@gmail.com>
- Date
- Jan 28, 2026, 00:42 UTC
- Message-ID
- <CA+5Chmhwcz=gOQHW18_w+uYojshjFj8MCE+srUpJgEhbh8J09w@mail.gmail.com>
Today Git only loads ignore rules from .gitignore (plus global and info/exclude), which works well but can become hard to maintain in large repositories where editor, build, and miscellaneous rules are mixed into a single file.
Would the Git project consider supporting additional named ignore files (for example editor.gitignore, build.gitignore) that are automatically merged with .gitignore, with a well-defined and documented precedence order?
This would allow semantic separation of ignore rules while keeping full backward compatibility, and could reduce the need for external scripts that currently exist solely to generate .gitignore.
I’m mainly interested in whether this idea has been considered before, and whether the maintainers see fundamental design objections to it.