Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Understand what .gitignore rule is ignoring your files — First published in issue #54

Understand what .gitignore rule is ignoring your files

Ready to commit, you fire your git status and you don’t see your files 🤔.

Use this command to ask Git what rule is causing this ignore:

$ git check-ignore -v filename

For instance to see what rule ignores tests.pyc:

$ git check-ignore -v tests.pyc
.gitignore:1:*.pyc    tests.pyc

Here we see it’s the first line of the .gitignore file that is in effect. You can also use git status --ignored to show the files being ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.