Skip to content

[Feature Request] Add untracked files / stash entries to .git/info/exclude from UI #2670

Description

@iletai

Problem

When working on a project, developers often create local-only files that should never be committed: personal scripts, IDE/editor workspace files, local environment overrides, debug logs, experimental patches stashed away, etc.

Adding these to .gitignore pollutes the shared repository — every team member gets the exclusion, even though the files are irrelevant or private to one person. Editing .git/info/exclude manually requires dropping into the terminal, finding the file in Finder, or navigating Forks file tree to a hidden .git directory — all friction that breaks flow.

Proposed Solution

Add contextual UI actions that write entries to .git/info/exclude (the per-repo local exclusion file):

Action Where What it does
"Exclude file locally" Right-click on an untracked file in the Changes view Appends the file path to .git/info/exclude and immediately removes it from the untracked list
"Exclude folder locally" Right-click on an untracked folder Appends folder_name/ to .git/info/exclude
"Exclude pattern locally" Right-click → a sub-option that opens an inline editor pre-filled with the file path, letting the user tweak it into a glob pattern before saving Full pattern flexibility (e.g. *.log, build/*)
"Edit .git/info/exclude…" Fork menu → Repository (or a gear icon in Changes view) Opens the file in Forks built-in editor (or the system default editor)

Why .git/info/exclude (not global .config/git/ignore)

Per-repo exclusion is the right default for most cases:

  • A file that is irrelevant in this repo may be meaningful in another.
  • Stash entries that should be hidden in one project may need to appear elsewhere.
  • The exclusion is automatically cleaned up when the repo is deleted — no orphaned global rules.

A follow-up could add a global ignore option too (#688 covers that), but the per-repo UI is the more immediate pain point.

Use Cases

  1. Local scratch/notes files: You create notes.md or debug.log while investigating a bug. You want them tracked by git? No. You want them visible in Forks Changes view cluttering the diff? No. → "Exclude file locally."
  2. Stashed experimental work you want to keep out of sight: You have a stash that touches files you dont want to see in the working tree. → "Exclude pattern locally."
  3. IDE/editor files that differ per machine: .vscode/settings.json with machine-specific paths. → Folder-level exclude.
  4. Build/test artifacts that fall outside .gitignore: e.g. a test_output/ directory generated by a script you wrote for yourself.

Existing Related Issue

#688 covers global gitignore (~/.config/git/ignore). This request is complementary — it targets the per-repo .git/info/exclude file, which is a different mechanism with different scope and trade-offs.

Implementation Notes

  • Fork already has access to the repo path and can read/write .git/info/exclude via the embedded git (or directly as a text file).
  • The file format is identical to .gitignore — same pattern syntax, same rules.
  • No git command is needed to apply the exclusion — git reads .git/info/exclude automatically on the next git status.
  • A "Reveal in Finder" button next to the Exclude actions would help users who want to manually edit the file further.

Would love to hear thoughts from the team and the community!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions