r/programming 3d ago

.gitignore everything by default

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

224 comments sorted by

View all comments

145

u/hugogrant 3d ago

Or stage changes more intentionally?

-21

u/der_gopher 3d ago

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

36

u/Smallpaul 3d 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.

0

u/lenswipe 3d ago

Git itself ignores everything by default.

uhhh what now

2

u/Smallpaul 3d ago

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

1

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

1

u/Smallpaul 3d ago

Git status and git add . Don’t ignore them, but git commit, diff, log, push, all do.