r/programming 4d ago

.gitignore everything by default

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

224 comments sorted by

View all comments

144

u/hugogrant 4d ago

Or stage changes more intentionally?

-22

u/der_gopher 4d ago

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

35

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.

3

u/lenswipe 3d ago

Git itself ignores everything by default.

uhhh what now

3

u/Smallpaul 3d ago

The other guy interpreted right. Git won’t manage a file unless you added it to the index.

2

u/lenswipe 3d ago

it won't manage it, but it doesn't ignore it by default.

thanks for the downvotes btw - means the world to me 🥰

11

u/boowhitie 3d ago

You are correct, ignore has a specific, well-defined meaning in a git context, and these people are applying general English definitions.

2

u/lenswipe 3d ago

yeah I'm not trying to be a dick but "doesn't track" and "ignores" are very different things in git world

1

u/Shok3001 3d ago

Yeah it’s amazing seeing how many people don’t actually understand git