[RFC PATCH] dir: add discoverable local-only .gitlocalignore#2177
Open
Msalways wants to merge 3 commits into
Open
[RFC PATCH] dir: add discoverable local-only .gitlocalignore#2177Msalways wants to merge 3 commits into
Msalways wants to merge 3 commits into
Conversation
Introduce a root-level, local-only ignore file '.gitlocalignore' that is read only when core.gitLocalIgnore is enabled (off by default, to avoid surprising repositories that already contain such a file). It is self-excluding (the file itself is ignored) and ranked below .git/info/exclude but above core.excludesFile in precedence. This gives users a discoverable place for machine-local ignore rules without committing them to the repository. Signed-off-by: Shanthosh <shanthubolt@gmail.com>
Author
|
/preview |
|
Error: User Msalways is not yet permitted to use GitGitGadget |
Exercise the new discoverable, local-only ignore file: gating via core.gitLocalIgnore, self-exclusion, precedence relative to info/exclude and core.excludesFile, root-only scoping, and that ignored files stay out of git status and cannot be added without -f. Signed-off-by: Shanthosh <shanthubolt@gmail.com>
Document the new root-level, local-only ignore file and its core.gitLocalIgnore switch, including precedence and the fact that the file is self-excluding and never tracked. Signed-off-by: Shanthosh <shanthubolt@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This RFC proposes a new, discoverable, local-only ignore file:
.gitlocalignore, enabled viacore.gitLocalIgnore.Motivation
Many users want machine-local ignore rules (paths that exist only in
their checkout) without committing them. Today the only private option
is
.git/info/exclude, which is undiscoverable: in a 2017 list threada contributor noted they "didn't even know .git/info/exclude existed."
.gitignoreis discoverable but shared/committed, which is wrong forlocal-only rules.
Design
.gitlocalignoreat the working-tree root is read onlywhen
core.gitLocalIgnoreis true (false by default), so repositoriesthat already contain such a file are not surprised.
.gitlocalignoreis ignored by Git itself andnever tracked or pushed.
.git/info/exclude>.gitlocalignore>core.excludesFile..gitlocalignorefiles are not read (the file is asingle, discoverable location).
Prior art
A 2026 worktreeIgnore proposal was rejected for lacking a compelling
use case; this targets the concrete discoverability gap. Note that a
repository (0lumide/matterbridge-dummy) already ships a file named
.gitlocalignore, which is why the feature is gated behindcore.gitLocalIgnorerather than always on.This series adds the implementation (setup_standard_excludes), tests,
and documentation.