.gitignore Isn't the only way to ignore files in Git(nelson.cloud)
439 points by FergusArgyll 1 day ago | 134 comments
tl;dr: Git supports three levels of ignore files: the usual `.gitignore` (committed to the repo), `.git/info/exclude` (per-repo, not committed, useful for personal files), and `~/.config/git/ignore` (global, machine-wide, ideal for things like `.DS_Store`). The global file location can be customized via `git config --global core.excludesFile`, and `git check-ignore -v <file>` reveals which rule and file is causing a given path to be ignored.
HN Discussion:
  • Sharing additional personal workflows/tricks for ignoring files that complement the article
  • Surprise and gratitude at learning about the exclude/global ignore features
  • ~Article missed related useful features like .gitattributes for ignoring diffs
  • ~Clarifying or correcting article terminology, e.g. 'global' means per-user not machine-wide
  • Caution that per-user ignores like .DS_Store are better handled project-wide