git ignore

Updated: 25 January 2024

Git ignore uses globbing patterns.

Ignore .env file in current directory only and not .env files which might occur further down the directory structure

# .gitignore

/.env

Find which .gitignore entry is responsible for ignoring a particular file

git check-ignore --verbose file/to/check.cs

Show all files being ignored, recursively

find . -type f  | git check-ignore --verbose --stdin

Leave a comment