Which file is used to specify files that Git should ignore?

  1. .gitignore
  2. .ignore
  3. .exclude
  4. .gitexclude

Explanation

The .gitignore file specifies intentionally untracked files that Git should ignore. It contains patterns matching files and directories that should not be tracked by version control.