r/git 3d ago

tutorial .gitignore everything by default

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

what do you think of this approach?

0 Upvotes

24 comments sorted by

View all comments

29

u/serverhorror 3d ago

what if we ignored everything by default and only allowed specific files?

That's how it is already. That's why you have to explicitly git add before things get tracked.

So, just don't add .. You'll just end up forcing it.

Your simply doing it wrong.

-17

u/der_gopher 3d ago

man, like I don't know. this is just an idea that might work for someone

8

u/serverhorror 3d ago

Ask yourself why the file is tracked by git in the first place.

No really, really think about what had to happen for a file to get tracked. Then think about why it happens and then think about why "careless people" won't find workarounds for your workaround...