If .gitignore isn't ignoring a file, check these first:
- Is the file already tracked?
git ls-files --error-unmatch path/to/file
If it is tracked:
git rm --cached path/to/file
- Find which rule matches:
git check-ignore -v path/to/file
- Test a tracked file against your rules:
git check-ignore -v --no-index path/to/file
- Check for other ignore sources:
Nested .gitignore files
.git/info/exclude
Global Git excludes
- Check your pattern carefully. build/, build/, and build/* don't mean exactly the same thing.
I built IgnoreDebugger to make this easier — paste your .gitignore rules and a file path to see which rule matches and why.
Top comments (0)