.ignore files

Many tools use hidden files ending with ignore such as:

  • .dockerignore (Docker)
  • .gitignore (Git)
  • ...

Most share the same syntax based on wildcards. They will "ignore" any matching file.

*                   # all files
*.exe               # all files ending with .exe
!test.exe           # do not ignore "test.exe"
build/              # any build folder
/build/             # only the build inside the root
**/build/           # any nested build folder

➑️ A .ignore file is applied starting from the root directory, which is the directory the .ignore file is in.