.gitignore Isn't the only way to ignore files in Git

Per‑repo vs. user/global ignore mechanisms

  • Many commenters highlight .git/info/exclude for per‑repo, per‑user ignores (e.g., local scripts, Makefiles, sample data, notes) without polluting shared .gitignore.
  • Global/user‑wide ignores via ~/.config/git/ignore (or equivalent) are emphasized as underused, ideal for OS/editor cruft (e.g., .DS_Store, IDE folders).
  • Clarification: --global in Git is per‑user; true machine‑wide config is --system (e.g., /etc/gitignore), which is rarely recommended and can be overridden by user config.
  • Some tools (Magit) expose a UI to choose between shared .gitignore and private .git/info/exclude.

What belongs in .gitignore vs global ignores

  • One camp: repo .gitignore should only cover repo‑specific artifacts (build outputs, dependency folders). User‑specific/IDE/OS files belong in each developer’s global ignore.
  • Another camp: add common OS/IDE junk (e.g., .DS_Store, .vscode, .idea) to repo .gitignore to protect less‑experienced contributors and reduce review friction.
  • Tension noted: strict “project‑only” policy vs pragmatic prevention of recurring mistakes; concern about .gitignore files accumulating IDE‑ and platform‑specific “cruft.”

Local scratch / “attic” directories

  • Several patterns for local junk areas:
    • A globally ignored directory name like attic, aux, or scratch/.
    • Per‑dir .gitignore with * so the directory and all contents (including the ignore file itself) are ignored.
  • These are used for personal notes, experiments, or editor/project files that should never be committed.

Git ergonomics, complexity, and discoverability

  • Some see the article as a light rehash of the official docs; others say it surfaced features they “always wanted” but never knew existed.
  • Git is described both as “beautifully versatile” and as confusing enough that users can’t always predict command effects.
  • Discovery is a recurring theme: Git often can do what people want; the hard part is learning the right incantation.

Beyond ignores: related tools and tricks

  • .gitattributes mentioned for treating some files as “diff‑ignored” (or with custom merge strategies), especially large lock files, though others argue these diffs are important for security and dependency auditing.
  • Hooks via a global hooks directory can block binary or large files, or enforce policies on lockfiles.
  • git update-index --assume-unchanged / --skip-worktree (often aliased) are used to locally modify tracked files without showing changes, though they’re easy to forget about.
  • includeIf in Git config allows per‑directory or per‑remote configuration (e.g., different emails per company).