DEV Community

Cover image for How I Finally Fixed My .gitignore (and Ended Up Writing an Extension)
Jasong
Jasong

Posted on

How I Finally Fixed My .gitignore (and Ended Up Writing an Extension)

I thought my .gitignore files were fine. Most of us probably do. You drop in a template, add a couple of custom patterns and believe everything is fine.

Except it often is not.

Typos slip in. Old entries linger. Some lines silently match nothing at all. Others match far more than you expect. I only realised this when I accidentally uploaded a file that should never have been in the repo. Unpicking it from multiple commits was a nightmare and it sent me down a rabbit hole.

To understand what was going on, I needed a quick way to see which patterns were actually matching something in my workspace. The real numbers.

Which is how IgnoreLens was born.

What IgnoreLens Does

IgnoreLens gives you a live insight into your .ignore files.

It shows:

  • how many files each ignore line matches
  • which patterns match zero files
  • places where you may have typos or dead entries

It simply shines a light on the reality of your ignore rules so you can tidy them up with confidence.

Try It Out (VS Code)

Marketplace:
https://marketplace.visualstudio.com/items?itemName=ignore-lens.ignore-lens

OpenVSX:
https://open-vsx.org/extension/ignore-lens/ignore-lens

It is my first VS Code extension, so if you have thoughts, feedback or ideas, I would love to hear them.

Top comments (2)

Collapse
 
a-k-0047 profile image
ak0047

Thank you for sharing useful extension.
I'll give it a try!

Collapse
 
mateorod_ profile image
Mateo Rodriguez

Cool idea—GitHub's own gitignore templates are huge partly because .gitignore is so subtle (order, directory vs file patterns, negation). A lens on what's actually matching is super handy.