Ignore

Per-repository

  • .gitignore files in each directory.
  • ${GIT_DIR:-/.git}/info/exclude at the root of the repository.
    • When excluding files that are checked in, use git update-index --assume-unchanged <file...> to ignore existing content changes.

Globally

Configure core.excludesfile to point to e.g. ~/.gitexcludes. This will behave like a .gitignore or exclude file.