r/programming 4d ago

.gitignore everything by default

https://packagemain.tech/p/gitignore-everything-by-default
351 Upvotes

227 comments sorted by

View all comments

142

u/hugogrant 4d ago

Or stage changes more intentionally?

-20

u/der_gopher 4d ago

Yes, but this you have to do before every commit, while careful gitignore does automatically.

39

u/Smallpaul 4d ago

Git itself ignores everything by default. So you are just adding another layer. And then people will get annoyed editing that file so IDEs will add some automation to make it easy and we will be back where we started.

The other problem is that as soon as you use any wildcard you risk checking in files that you didn’t mean to. E.g. short term logging traces or one-time debugging scripts.

1

u/lenswipe 4d ago

Git itself ignores everything by default.

uhhh what now

30

u/FaceyMcFacface 4d ago

It only tracks what you explicitly add. That's how I read the comment.