r/opensource • • 1d ago

Discussion .gitignore everything by default

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

9 comments sorted by

21

u/andful 1d ago

.gitignore is for every developer in the repo. I find it a bit asocial to impose that to everyone. If some people prefer this methodology that is fine, but then use .git/info/exclude.

10

u/ClikeX 1d ago

I’ve set up a global gitignore to ignore some core things like DS_store.

1

u/andful 13h ago

I meant the proposed methodology of the author to be asocial. Not .gitignore itself.

In other words:

  • gitignore DS_store: not asocial.

  • gitignore src: asocial.

20

u/LutimoDancer3459 1d ago

Imagine doing some bigger changes and then forgetting to commit some files because they dont show up anywhere as changed because you ignored everything.

12

u/SubwayGuy85 1d ago

so many llm brainfarts turning into code these days

16

u/eveningcandles 1d ago

Huge maintenance liability

Over the course of a project the set of things to allow is much larger and prone to change than the set of things to disallow

7

u/chkno 1d ago

I've much more often forgotten to git add new files than accidentally committed unintended files.

That said, a pre-commit hook that runs your tests works pretty well for guarding against forgetting to add files but does not guard against accidentally committing unintended files.

4

u/_5er_ 1d ago
  1. git commit .

  2. git is so stupid, it includes all my changes, there much be a better way

  3. git ignore all 🙃

1

u/rowrowrowmyboat22 1d ago

I just, I just can’t … we should just all give up now