git check-ignore .env

Category: Git - Core

git check-ignore .env

Test whether a path is ignored

Prints the path if .gitignore rules ignore it and exits zero, or exits non-zero if the file would be tracked. Scripts use it to verify ignore patterns. Add -v to see which specific rule matched.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.