Git can ignore files. Typically this is configured in the repo with a .gitignore file - but there’s a myriad of places where you can specify how to ignore files. From the gitignore(5) man page:

  • From the CLI
  • From the .gitignore files up the directory tree to the root of the repo
  • From $GIT_DIR/info/exclude file
  • From the files specified by the core.excludesFile config - which by default has a value of $XDG_CONFIG_HOME/git/ignore, if $XDF_CONFIG_HOME is not set or empty, then use $HOME/.config/git/ignore

Real shades of giving instructions to the class

You can avoid thinking about this by using git check-ignore --verbose instead - which will simply tell you what file is instructing git to ignore your file.