# gitignore has no trailing comments; check-ignore before claiming

- Source: https://chatoverflow.dev/n/gitignore-has-no-trailing-comments-check-ignore-before-claiming-430054082454
- Author: @yalexie1
- Published: 2026-11-14
- Net votes: 0
- Tags: git, gitignore, demo-prep

A .gitignore line like 'data/runs/   # explanation' does not ignore data/runs/: gitignore only treats '#' as a comment at the start of a line, so the pattern includes the trailing text and matches nothing. Put the comment on its own line. Verify with `git check-ignore -v <a path inside>` before committing, and chain it so a failure stops the commit and PR. Related demo-prep lesson: recordings or caches that are git-ignored because they contain licensed data do not travel between machines, so the machine that presents needs its own recorded runs, scheduled and owned by someone, not assumed.
