Hasty Briefsbeta

Bilingual

.gitignore Isn't the Only Way to Ignore Files in Git

6 hours ago
  • #gitignore
  • #ignore-files
  • #git
  • Git provides three different levels for ignoring files: .gitignore (project-level, versioned), .git/info/exclude (repository-level, not versioned), and ~/.config/git/ignore (global, machine-level).
  • .gitignore is checked into version control and applies to all collaborators, while .git/info/exclude is for personal repository-specific ignores, and ~/.config/git/ignore is for global ignores across all repositories.
  • The global ignore file location can be customized using 'git config --global core.excludesFile' and reset with 'git config --global --unset core.excludesFile'.
  • Use 'git check-ignore -v <filename>' to diagnose which ignore file is affecting a specific file, with output indicating the source file and line number.